Kernel panic - not syncing: VFS: unable to mount root fs
Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Kernel panic - not syncing: VFS: unable to mount root fs
After following LFS book, when I reboot, I get GRUB prompt.
I am able to see kernel file by typing
Quote:
ls (hd0,gpt2)/boot
then I type below to boot the o.s.
Quote:
linux (hd0,gpt2)/boot/vmlinuz-4.18.5-lfs-8.3 root=/dev/sda2 rootdelay=10 ro
boot
System unable to boot and I get "Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(0,0) "
When I try to boot from rescue centos boot CD, I am able to chroot into /mnt/sysimage
This system is running on VMWare workstation. I tried searching web and many threads say I may need initramfs, but per book it is not needed at this point.
I'm using EFI and lfs is on an external drive partitioned with GPT. I'm chainloading onto a grub on the external drive from the host systems grub.
grub.cfg:
Code:
set default=0
set timeout=5
insmod gzio
insmod part_gpt
insmod ext2
search --set=root -fs-uuid f3af66ea-a164-4eb9-81b6-9107b913e070
insmod efi_gop
insmod efi_uga
insmod font
if loadfont /boot/grub/fonts/unicode.pf2; then
loadfont /boot/grub/fonts/unicode.pf2
set gfxmode=auto
set gfxpayload=keep
terminal_output gfxterm
fi
menuentry "LFS" {
linux /boot/vmlinuz-4.18.5-lfs-8.3 root=PARTUUID=436e23ec-52b7-4b5b-810d-1d8f44199663 ro rootfstype=ext4
}
Have you tried it with a rootdelay=10
"root=PARTUUID=436e23ec-52b7-4b5b-810d-1d8f44199663 rootdelay=10 ro"
Not sure about UUID in fstab, Partuuid works, root=PARTUUID=436e23ec-52b7-4b5b-810d-1d8f44199663
and boot is on / partition not seperate partition?
So you are using grub from lfs? on sdb with your own grub.cfg?
If you are trying to boot grub from another grub, "chainloader" that dosn't look like a chainloader menuentry.
Why dont you boot from the usb drive 1st, "select boot from usb" in bios or from special key F12 or what ever it is. Then just create a simple grub.cfg in LFS.
I did just try the rootdelay=10... still couldn't mount root, and I didn't find anything useful in the output before that either...
boot is on / partition, yes. /boot/efi though is a seperate vfat partition.
grub does work, I tried it without chainloading too...
my host systems grub.cfg is here, for reference, but I don't think it's going to be very useful:
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=10
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30,0; then
clear
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=1
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
linux /boot/vmlinuz-4.15.0-45-generic root=UUID=893ce94c-ef59-48fd-aba9-6e5b357ce409 ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.15.0-45-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
menuentry 'Ubuntu, with Linux 4.15.0-45-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-45-generic-advanced-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
echo 'Loading Linux 4.15.0-45-generic ...'
linux /boot/vmlinuz-4.15.0-45-generic root=UUID=893ce94c-ef59-48fd-aba9-6e5b357ce409 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-45-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-45-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-45-generic-recovery-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
echo 'Loading Linux 4.15.0-45-generic ...'
linux /boot/vmlinuz-4.15.0-45-generic root=UUID=893ce94c-ef59-48fd-aba9-6e5b357ce409 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-45-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-44-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-44-generic-advanced-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
echo 'Loading Linux 4.15.0-44-generic ...'
linux /boot/vmlinuz-4.15.0-44-generic root=UUID=893ce94c-ef59-48fd-aba9-6e5b357ce409 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-44-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-44-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-44-generic-recovery-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
echo 'Loading Linux 4.15.0-44-generic ...'
linux /boot/vmlinuz-4.15.0-44-generic root=UUID=893ce94c-ef59-48fd-aba9-6e5b357ce409 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-44-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-43-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-43-generic-advanced-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
echo 'Loading Linux 4.15.0-43-generic ...'
linux /boot/vmlinuz-4.15.0-43-generic root=UUID=893ce94c-ef59-48fd-aba9-6e5b357ce409 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-43-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-43-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-43-generic-recovery-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
echo 'Loading Linux 4.15.0-43-generic ...'
linux /boot/vmlinuz-4.15.0-43-generic root=UUID=893ce94c-ef59-48fd-aba9-6e5b357ce409 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-43-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-32-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-32-generic-advanced-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
echo 'Loading Linux 4.15.0-32-generic ...'
linux /boot/vmlinuz-4.15.0-32-generic root=UUID=893ce94c-ef59-48fd-aba9-6e5b357ce409 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-32-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-32-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-32-generic-recovery-893ce94c-ef59-48fd-aba9-6e5b357ce409' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2 893ce94c-ef59-48fd-aba9-6e5b357ce409
else
search --no-floppy --fs-uuid --set=root 893ce94c-ef59-48fd-aba9-6e5b357ce409
fi
echo 'Loading Linux 4.15.0-32-generic ...'
linux /boot/vmlinuz-4.15.0-32-generic root=UUID=893ce94c-ef59-48fd-aba9-6e5b357ce409 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-32-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'unknown Linux distribution (on /dev/sdd4)' --class linux --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-f3af66ea-a164-4eb9-81b6-9107b913e070' {
insmod part_gpt
insmod ext2
set root='hd3,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt4 --hint-efi=hd3,gpt4 --hint-baremetal=ahci3,gpt4 f3af66ea-a164-4eb9-81b6-9107b913e070
else
search --no-floppy --fs-uuid --set=root f3af66ea-a164-4eb9-81b6-9107b913e070
fi
linux /boot/vmlinuz-4.18.5-lfs-8.3 root=/dev/sdd4
}
submenu 'Advanced options for unknown Linux distribution (on /dev/sdd4)' $menuentry_id_option 'osprober-gnulinux-advanced-f3af66ea-a164-4eb9-81b6-9107b913e070' {
menuentry 'unknown Linux distribution (on /dev/sdd4)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.18.5-lfs-8.3--f3af66ea-a164-4eb9-81b6-9107b913e070' {
insmod part_gpt
insmod ext2
set root='hd3,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt4 --hint-efi=hd3,gpt4 --hint-baremetal=ahci3,gpt4 f3af66ea-a164-4eb9-81b6-9107b913e070
else
search --no-floppy --fs-uuid --set=root f3af66ea-a164-4eb9-81b6-9107b913e070
fi
linux /boot/vmlinuz-4.18.5-lfs-8.3 root=/dev/sdd4
}
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
menuentry "LFS on USB Drive" {
insmod chain
set root='hd0,gpt1'
chainloader /efi/lfs/grubx64.efi
}
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
the lfs entry is very far down, in custom_40 of course
Last edited by removed036; 02-19-2019 at 11:40 AM.
Reason: added 1 line
I took a photo of the kernel panic and attached it.
I already thought it probably has to be a driver issue, but I don't know which drivers/ kernel options I have to look at... I did already check that ext4 support is built in and some options that I found with google searching, but couldn't find what was missing
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.