Search code examples
linuxlinux-kernellinux-from-scratch

LFS custom Linux kernel panics on boot


So I recently finished my own Linux From Scratch build (7.9-SYSTEMD), following the book character for character (did not strip the libraries nor have I removed the unneeded static libraries) and am trying to build the kernel. When booting into the system (on EITHER the original host or on it's own using GRUB) it returns with an error:

---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Both the LFS Host and Target are Virtual Machines on my computer. Support for both the drive type (SCSI) and file system (ext4) are included in the kernel itself and are not modules.

If need be, I can screenshot the full stack trace and link to it here.

EDIT: This is my current grub commands at boot time:

setparams 'Linux From Scratch (7.9-systemd) (on (/dev/sdb3)
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt2'

    linux /vmlinuz-4.4.2-lfs-7.9-systemd root=/dev/sda2 ro

Looking at this, it seems like it is trying to put the device (/dev/sdb2) as /dev/sda2

EDIT: Here is a link to a snapshot of the stack trace (no, I cannot just copy/paste as it is in the kernel boot and has no support for it) Kernel Panic Stack Trace Error


Solution

  • So the main issue that I was coming across is that LFS, by default, does not support virtualization, so the LFS build must be run on a bare metal machine.