LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   kernel panic not syncing no init found try passing init option to kernel (https://www.linuxquestions.org/questions/linux-from-scratch-13/kernel-panic-not-syncing-no-init-found-try-passing-init-option-to-kernel-4175443799/)

k84834 01-02-2013 07:30 AM

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

malekmustaq 01-02-2013 09:23 AM

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.

k84834 01-02-2013 01:32 PM

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?! :-?

spiky0011 01-02-2013 01:48 PM

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.

k84834 01-05-2013 11:19 PM

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

spiky0011 01-06-2013 01:48 AM

What have you done so far?
How are you trying to boot lfs "using which grub"? host or lfs

k84834 01-06-2013 03:02 AM

Quote:

Originally Posted by spiky0011 (Post 4863774)
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

spiky0011 01-06-2013 03:18 AM

Yes thats roughly how I do it as well.
Is lfs the only OS on the drive or is it dual boot

spiky0011 01-06-2013 03:41 AM

I also check the file system when it's been copied across using gparted or something.

k84834 01-06-2013 04:28 AM

Quote:

Originally Posted by spiky0011 (Post 4863797)
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?

spiky0011 01-06-2013 04:32 AM

I use gparted and shrink it down, You must run some sort of file check on it

k84834 01-06-2013 07:12 AM

:(
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?

Keith Hedger 01-06-2013 07:28 AM

Quote:

Originally Posted by k84834 (Post 4863818)
...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.

spiky0011 01-06-2013 07:56 AM

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

k84834 01-07-2013 12:00 AM

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.


All times are GMT -5. The time now is 09:52 PM.