LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   About booting of LFS7.2 (https://www.linuxquestions.org/questions/linux-from-scratch-13/about-booting-of-lfs7-2-a-4175439933/)

swatch 12-04-2012 03:31 AM

About booting of LFS7.2
 
First,I just do the LFS7.2 in the USB.
After I had done the LFS7.2 system ,I rebooted the system and chose the LFS7.2 system.It booted but sometime it stopped.The screen happens:
No filesystem could mount root,tried :ext3 vfat msdos iso9660
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,5)
Pid:1,comm:swapper/0 Not tainted 3.5.2 #1
Call Trace
Could anyone help me ?

spiky0011 12-04-2012 04:50 AM

Hi

Can you post your grub.cfg file and
Fstab

Lennie 12-04-2012 06:49 AM

What filesystem do you have? I remember I had to add ext4 to the kernel. If you don't use an initrd, you should include it in the kernel(y) not as module(m). And then recompile the kernel.

swatch 12-04-2012 06:55 AM

2 Attachment(s)
Quote:

Originally Posted by spiky0011 (Post 4842356)
Hi

Can you post your grub.cfg file and
Fstab

sure.fstab:# Begin /etc/fstab
# file system mount-point type options dump fsck
# order
/dev/sda5 / ext3 defaults 1 1
/dev/sda1 swap swap pri=1 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
noauto,user,quiet,showexec,iocharset=utf8,codepage=936
# End /etc/fstab
grub.cfg:# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext3
set root=(hd0,5)
menuentry "GNU/Linux, Linux 3.5.2-lfs-7.2" {
linux /boot/vmlinuz-3.5.2-lfs-7.2 root=/dev/sda5 ro
}

swatch 12-04-2012 07:12 AM

Quote:

Originally Posted by Lennie (Post 4842442)
What filesystem do you have? I remember I had to add ext4 to the kernel. If you don't use an initrd, you should include it in the kernel(y) not as module(m). And then recompile the kernel.

My filesystem is ext3.

spiky0011 12-04-2012 07:15 AM

Hi

Is lfs on usb and where did you install
Grub. Are you booting from usb.
When I built mine on a usb I had to put a delay
When booting usb. Im not at pc at moment but will
Look later and post

swatch 12-04-2012 07:25 AM

Quote:

Originally Posted by spiky0011 (Post 4842465)
Hi

Is lfs on usb and where did you install
Grub. Are you booting from usb.
When I built mine on a usb I had to put a delay
When booting usb. Im not at pc at moment but will
Look later and post

Yes,I install my lfs on my usb .The grub is in /boot/grub.I booted from usb.It was really booted.But it didn't come into LFS system impartially.

Lennie 12-04-2012 07:38 AM

Are you sure your usb is called sda? You can use uuid in fstab, it's more reliable. Grub thinks it is always on the first disc, but the kernel counts different than grub. Even if you change boot order in bios and boot from usb, it doesn't change your usb to sda if you have an internal drive.

swatch 12-04-2012 07:47 AM

Quote:

Originally Posted by Lennie (Post 4842494)
Are you sure your usb is called sda? You can use uuid in fstab, it's more reliable. Grub thinks it is always on the first disc, but the kernel counts different than grub. Even if you change boot order in bios and boot from usb, it doesn't change your usb to sda if you have an internal drive.

I had tried sdb and sdc ,but it doesn't work.

spiky0011 12-04-2012 11:33 AM

Hi

You need to find out as Lennie pointed out what your usb is mounted as.
The output of
Code:

sudo blkid
Puts mine as sdc1.
so my fstab looks like this
Code:

# Begin /etc/fstab

# file system  mount-point  type  options        dump  fsck
#                                                        order

/dev/sdc1      /            ext4  defaults        1    1
/dev/sdc2      swap        swap  pri=1          0    0
/dev/sdc5      /home/spiky/Spiky        ext4  defaults        0    2
proc          /proc        proc  defaults        0    0
sysfs          /sys        sysfs  defaults        0    0
devpts        /dev/pts    devpts gid=4,mode=620  0    0
tmpfs          /run        tmpfs  defaults        0    0
# End /etc/fstab

Although grub will look at the drive as the 1st drive, my grub.cfg
Code:

# Begin /boot/grub/grub.cfg
set default=0
set timeout=5


insmod ext2
set root=(hd0,1)

menuentry "Planet-Spike7" {
        linux  /boot/vmlinuz-3.2-lfs-7.0 root=/dev/sdc1 rootdelay=5 ro
}

set default=0
set timeout=5


insmod ext2
set root=(hd0,1)

menuentry "Panic-Button" {
        linux    /boot/vmlinuz-3.1-lfs-7.0-org root=/dev/sdc1 rootdelay=5 ro
}

Hence (hd0,1) and root is set as sdc1.
I had to add the rootdelay=5 as the usb takes time to be recognised maybe set yours to 10,

swatch 12-04-2012 11:30 PM

Quote:

Originally Posted by spiky0011 (Post 4842665)
Hi

You need to find out as Lennie pointed out what your usb is mounted as.
The output of
Code:

sudo blkid
Puts mine as sdc1.
so my fstab looks like this
Code:

# Begin /etc/fstab

# file system  mount-point  type  options        dump  fsck
#                                                        order

/dev/sdc1      /            ext4  defaults        1    1
/dev/sdc2      swap        swap  pri=1          0    0
/dev/sdc5      /home/spiky/Spiky        ext4  defaults        0    2
proc          /proc        proc  defaults        0    0
sysfs          /sys        sysfs  defaults        0    0
devpts        /dev/pts    devpts gid=4,mode=620  0    0
tmpfs          /run        tmpfs  defaults        0    0
# End /etc/fstab

Although grub will look at the drive as the 1st drive, my grub.cfg
Code:

# Begin /boot/grub/grub.cfg
set default=0
set timeout=5


insmod ext2
set root=(hd0,1)

menuentry "Planet-Spike7" {
        linux  /boot/vmlinuz-3.2-lfs-7.0 root=/dev/sdc1 rootdelay=5 ro
}

set default=0
set timeout=5


insmod ext2
set root=(hd0,1)

menuentry "Panic-Button" {
        linux    /boot/vmlinuz-3.1-lfs-7.0-org root=/dev/sdc1 rootdelay=5 ro
}

Hence (hd0,1) and root is set as sdc1.
I had to add the rootdelay=5 as the usb takes time to be recognised maybe set yours to 10,

Thank you very much.I do it as you had said.Then it come into system.So this problem must be solved.But I have another question.That is when it check file systems ..,the screen happened:
/dev/sdc5: UNEXPECTED INCONSISTENCY ;RUN fsck MANUALLY.
(i.e., without -a or -p options)

swatch 12-04-2012 11:32 PM

Quote:

Originally Posted by Lennie (Post 4842494)
Are you sure your usb is called sda? You can use uuid in fstab, it's more reliable. Grub thinks it is always on the first disc, but the kernel counts different than grub. Even if you change boot order in bios and boot from usb, it doesn't change your usb to sda if you have an internal drive.

Thank you very much.The problem must be solved.But I have another question.That is when it check file systems ..,the screen happened:
/dev/sdc5: UNEXPECTED INCONSISTENCY ;RUN fsck MANUALLY.
(i.e., without -a or -p options)

swatch 12-05-2012 07:21 AM

Quote:

Originally Posted by spiky0011 (Post 4842665)
Hi

You need to find out as Lennie pointed out what your usb is mounted as.
The output of
Code:

sudo blkid
Puts mine as sdc1.
so my fstab looks like this
Code:

# Begin /etc/fstab

# file system  mount-point  type  options        dump  fsck
#                                                        order

/dev/sdc1      /            ext4  defaults        1    1
/dev/sdc2      swap        swap  pri=1          0    0
/dev/sdc5      /home/spiky/Spiky        ext4  defaults        0    2
proc          /proc        proc  defaults        0    0
sysfs          /sys        sysfs  defaults        0    0
devpts        /dev/pts    devpts gid=4,mode=620  0    0
tmpfs          /run        tmpfs  defaults        0    0
# End /etc/fstab

Although grub will look at the drive as the 1st drive, my grub.cfg
Code:

# Begin /boot/grub/grub.cfg
set default=0
set timeout=5


insmod ext2
set root=(hd0,1)

menuentry "Planet-Spike7" {
        linux  /boot/vmlinuz-3.2-lfs-7.0 root=/dev/sdc1 rootdelay=5 ro
}

set default=0
set timeout=5


insmod ext2
set root=(hd0,1)

menuentry "Panic-Button" {
        linux    /boot/vmlinuz-3.1-lfs-7.0-org root=/dev/sdc1 rootdelay=5 ro
}

Hence (hd0,1) and root is set as sdc1.
I had to add the rootdelay=5 as the usb takes time to be recognised maybe set yours to 10,

Hello,spiky0011.The problem had been solved.But I have another problem when system checking filesystem,the screen happened :/dev/sdc5 :unexpected inconsistency, run fsck manuallyCan you tell me what I should do ?Thank you.

Keith Hedger 12-05-2012 07:40 AM

You must boot to a live cd or a different partition from the one to check and run as root
Code:

e2fsck -C0 /dev/sdc5

erkant 12-05-2012 02:45 PM

Try using make defconfig while compiling the kernel, and try using it.


All times are GMT -5. The time now is 02:28 PM.