LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 01-02-2013, 07:30 AM   #1
k84834
Member
 
Registered: Aug 2012
Posts: 142

Rep: Reputation: Disabled
kernel panic not syncing no init found try passing init option to kernel


Hi
I built an LFS and I installed a GUI on it. this LFS has been built on a VM machine, so I want to transfer it to new partition on my hard. I copy LFS's files to my hard and I make it bootable then I install grub on it and I Edit my /etc/fstab and /boot/grub/grub.cfg files. now when I select LFS from grub menu I receive below error message:
Code:
scsi 1:0:0:0 Attached scsi generic sg1 type 5
md: Waiting for all devices to be available before autodetect
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices
md: autorun ...
md: ... autorun DONE
VFS: mounted root(vfat filesystem) readoly on device 8:1
devtmpfs: error mounting -2
Freeing unused kernel memory: 560k freed
Write protecting the kernel text: 7480k
Write protecting the kernel read-only data: 2348k 
Kernel panic - not syncing: No init found. Try passing init=option to kernel. see Linux Documentation/init.txt for guidance.
I have searched but I don't know why this error occurs!
I have not familiar with kernel configuration as well.
AND I have a question: why in the above log I see red part?!
my partition is Ext3 type.
if you need any info from my LFS for better guidance, tell me.
thank you

Last edited by k84834; 01-02-2013 at 07:52 AM.
 
Old 01-02-2013, 09:23 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
It is not an easy work as merely copying between VM and ext3 partition as can be inferred from your boot error report.

A matter of personal solution to simplify the work:

1. Download, burn and boot from a rescue disk, here is Gparted with gui.

2. Being booted from rescue liveCD you will need to "chroot" into the LFS partition which you have prepared. I assume you know how to do this already being an LFS builder yourself. If not then ask further.

3. Being chrooted now at LFS partition, from there run
Code:
~# grub-mkconfig -o /boot/grub/grub.cfg
~# grub-install /dev/sda (Note: verify first what is your hard drive's name, is it sda? and only use sda in that case, no partition [1,2...] number.)
Reboot.

You might need compile an initrd.img if booting raises a problem on file system.

Hope that helps.

Good luck.

Last edited by malekmustaq; 01-02-2013 at 09:25 AM.
 
Old 01-02-2013, 01:32 PM   #3
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Hi malekmustaq
thank you for your reply
Quote:
1. Download, burn and boot from a rescue disk, here is Gparted with gui.

2. Being booted from rescue liveCD you will need to "chroot" into the LFS partition which you have prepared. I assume you know how to do this already being an LFS builder yourself. If not then ask further.

3. Being chrooted now at LFS partition, from there run
Code:

~# grub-mkconfig -o /boot/grub/grub.cfg
~# grub-install /dev/sda (Note: verify first what is your hard drive's name, is it sda? and only use sda in that case, no partition [1,2...] number.)

Reboot.
I did according to what you say above and after it I received above error. I first used a live cd and parted my hard to one partition and make it ext3 type with "mke2fs -jv /dev/sda1" command. then I mount my hard to live cd and transfer LFS to it(extract my backup of LFS to hard).then I mounted virtual filesystem according to LFS book and chrooted to my LFS ,then with "grub-install /dev/sda" commmand I installed grub on it and Edited my fstab and grub.cfg files then by disk utility app make it bootable(enable bootable flag). then reboot and grub menu is appear on screen and I select my just os, LFS , and then above error eccurs.
please tell me your predicts.
what is the cause of this problem in your opinion?! :-?
 
Old 01-02-2013, 01:48 PM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

How I copy lfs to different machines is I dd the drive it,s on then dd to new drive.
I dont know if you can do this from vm though never used vm. If it dosn't boot it throughs me into grub prompt which I can recover from.
 
Old 01-05-2013, 11:19 PM   #5
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Hi spicky0011
can you tell me how you copy lfs to different machines by using dd command explicitly?
I am not familiar with this command and I have not any suggestion about how to use it!!!
your experience about transfer from one machine to another one maybe helpful for me
thank you
 
Old 01-06-2013, 01:48 AM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
What have you done so far?
How are you trying to boot lfs "using which grub"? host or lfs
 
Old 01-06-2013, 03:02 AM   #7
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
What have you done so far?
at this point I have an LFS that X Window System and Fluxbox and Firefox is installed on it.
I built my LFS on a VM machine. I have installed grub on lfs and I could boot up with LFS as a stand alone os.
then I boot with my host machine and mount my LFS to my host.
now I want to transfer my LFS to a hard drive.
for this, I think about below steps:
1st: make partition.image.bz2 file with using of dd command:
dd if=/dev/sdb1 of=/partition.image bs=4096 conv=notrunc,noerror
cd /
bzip2 partition.image
2nd: with winSCP I copy my image file to my flash memory.
3th: I boot up with a liveCD linux( I have fedora 13)and I mount my hard to it.
then cp my image file to my hard and then I restore it with these commands:
bunzip partition.image.bz2
dd if=partition.image of=/dev/sda1 bs=4096 conv=notrunc,noerror

first please tell me this steps are true?
then I have another question
 
Old 01-06-2013, 03:18 AM   #8
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Yes thats roughly how I do it as well.
Is lfs the only OS on the drive or is it dual boot
 
Old 01-06-2013, 03:41 AM   #9
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
I also check the file system when it's been copied across using gparted or something.
 
Old 01-06-2013, 04:28 AM   #10
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
Is lfs the only OS on the drive or is it dual boot
yes, lfs is the only OS on the drive.
but I have a question about dd command.
can I create image from a partition that just the files have copied to image file?
now I have a 10G partition that lfs is built on it, while 1.4G of it is used. when I run "dd if=/dev/sdb1 of=/partition.image bs=4096 conv=notrunc,noerror" command, whole of my partition is converted to image file and the size of image file is about 10G!
what do I do ?
I want to create a image file that have same size as used space on the partition. how do I it?
 
Old 01-06-2013, 04:32 AM   #11
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
I use gparted and shrink it down, You must run some sort of file check on it
 
Old 01-06-2013, 07:12 AM   #12
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled

I used gparted and shrink my 10G partition to 2G.
according to #7 post, transferring of LFS has same problem as post#1 .
this error(post #1)occur both post #2 steps and post #7 steps.
this means that my transferred files is correct and my hard is bootable.
what do you think?
is it related to my kernel config? what is the meaning of this kernel panic?
 
Old 01-06-2013, 07:28 AM   #13
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Quote:
Originally Posted by k84834 View Post
...can I create image from a partition that just the files have copied to image file?
now I have a 10G partition that lfs is built on it, while 1.4G of it is used. when I run "dd if=/dev/sdb1 of=/partition.image bs=4096 conv=notrunc,noerror" command, whole of my partition is converted to image file and the size of image file is about 10G!
what do I do ?
I want to create a image file that have same size as used space on the partition. how do I it?
This is what dd does it creates a one-one img of the source if you just want the files try cd'ing into the root of the (mounted) partion you want to save and try
Code:
tar -cvzf /path/to/store/archive .
And then to restore the files on a clean empty partion ( again mounted ) cd into it and use
Code:
tar -xvf /path/to/store/archive
Alternatively you can use the /dump/restore programs which is what I use for backing up and restoring partions.
 
Old 01-06-2013, 07:56 AM   #14
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
We know that the lfs works did you reinstall grub to /dev/sda, I would create new grub.cfg and fstab files copy fstab and grub.cfg to fstab-old grub.cfg-old.
I dont know what that kernel panic is Did you format drive to ext3 or 4 what ever you used to build
 
Old 01-07-2013, 12:00 AM   #15
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Hi again
for your reply up to this time thank you.
I go to grub menu and run below command:
ls (hd0,1) /
and my lfs root files was showed.
I change my grub config from "root=/dev/sda1" to "root=/dev/hda1" and my system booted but not complete. it is encounter with an FAILURE error that say the super block is wrong.
I predict maybe grub must be installed on /dev/hda ! but when I go to my live linux and mount my lfs and chroot to it, there is not hda device in /dev directory!
my hard is PATA but I dont know why in my live linux that lfs is mounted to it, there is no hda device and my hard is known as sda for live linux.
my grub on lfs is Grub-1.99 and live's Grub is 0.97
please guide me.
thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Diskless: Kernel panic-not syncing: No init found. Try passing init= option to kernel Pier Gentoo 6 10-10-2011 06:17 AM
Kernel panic-not syncing:No init found. Try passing init=option to kernel cucolin@ Ubuntu 5 12-26-2008 06:44 AM
Kernel panic - not syncing: No init found. Try passing init= option to kernel. john_schimandle Linux - Newbie 4 10-09-2008 02:40 AM
Kernel panic - not syncing: No init found. Try passing init= option to kernel ranjithmrk Linux - Newbie 4 08-22-2008 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 08:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration