LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block(0,0) (https://www.linuxquestions.org/questions/linux-from-scratch-13/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block-0-0-a-4175724942/)

klebermo 05-10-2023 02:36 PM

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block(0,0)
 
I have created a image file with this commands:

Code:

dd if=/dev/zero of=linux.img bs=16M count=1024
cfdisk linux.img
mkfs.ext4 linux.img

and installed a linux system following the instructions from the book Linux From Scratch 11.3. I have access to this system via chroot, but when I try run it with this command:

Code:

qemu-system-x86_64 -hda linux.img -vga std -m 4G
the initialization of the system is interrupted by the error described in the title of this question. my file /boot/grub/grub.cfg looks like this:

Code:

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

insmod ext4

menuentry "GNU/Linux, Linux 6.1.11-lfs-11.3" {
        linux  /boot/vmlinuz-6.1.11-lfs-11.3 root=/dev/hda1 ro

what I have tried:
  1. uncommenting the line set root=(hd0,2)' and trying the values hd0,0orhd0,1(the system not even initialize with this, and I got the errorhd0,X not found` after the grub start screen.
  2. changing the root value in the line started with linux in the menuentry option to /dev/loopXX (I got the same error).
  3. changing the root value in the line started with linux in the menuentry option to /dev/sda1 (in this case, same message, but with the block as (8,1)).
Anyone can tell me what I can do to fix this issue?

klebermo 05-10-2023 05:48 PM

I got an answer to that question here: https://unix.stackexchange.com/a/745535/93526. I tested the answer and works perfectly for my case.

wiigelec 05-17-2023 10:34 AM

the way to troubleshoot this is by getting a grub command line (c at grub boot screen) then using ‘ls’ to find where your kernel is located. then use “set root=<kernel partition>“, “linux <kernel path> root=<root fs>”, then “boot”.

when i build lfs on a virtual disk (i use qcow2 format) i run fdisk on the image and partition it like a physical disk. though i use lvm for all my disks which adds another layer of complexity in the form of an initrd…


All times are GMT -5. The time now is 07:35 PM.