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 (https://www.linuxquestions.org/questions/linux-from-scratch-13/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-4175648024/)

mmjj 02-10-2019 01:43 PM

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.

Can you help or suggest what should I try next?

spiky0011 02-11-2019 01:15 PM

Hi
Its in the kernel config, you need to check for any thing vm related, I dont build in VM but thats where the trouble is.

I presume that LFS is on ext4 fs and sda2 is the root

mmjj 02-11-2019 02:45 PM

Yes LFS is on ext4 fs and /dev/sda2 is root

removed036 02-16-2019 08:37 AM

I'm having the same problem now. I specified root with PARTUUID

spiky0011 02-16-2019 09:46 AM

Hi

Can you post more info, grub.cfg, fstab and where lfs is mounted. Is it on a GPT partition? Dose the machine boot with EFI or Legacy bios?

removed036 02-18-2019 03:45 PM

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
}

fstab:
Code:

# Begin /etc/fstab

# file system    mount point    type    options                    dump    fsck order
#

04fdde9f-9362-401c-8d86-554d2a5aed6a swap swap pri=1              0      0
f3af66ea-a164-4eb9-81b6-9107b913e070 / ext4 defaults              0      0
proc            /proc          proc    nosuid,noexec,nodev        0      0
sysfs            /sys          sysfs  nosuid,noexec,nodev        0      0
devpts          /dev/pts      devpts  gid=5,mode=620            0      0
tmpfs            /run          tmpfs  defaults                  0      0
devtmpfs        /dev          devtmpfs mode=0755,nosuid          0      0
c692b4ab-2bc1-4fad-a4b5-41e0a2f9886a /home ext4 defaults          0      0
f892539e-a228-45c4-9a33-6cc5ada49871 /opt ext4 defaults            0      0
25be5637-1d01-4435-bf78-21141d8e1b8d /src ext4 defaults            0      0
83DA-A36D        /boot/efi      vfat    defaults                  0      1
efivarfs        /sys/firmware/efi/efivars efivarfs defaults      0      1
# End /etc/fstab

Sorry for the late reply btw :3

spiky0011 02-18-2019 03:59 PM

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.

removed036 02-19-2019 11:39 AM

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

colorpurple21859 02-19-2019 12:15 PM

drivers for hard drive and filesystem maybe missing or compiled as modules instead of into the kernel.

post the 4 to 5 lines before this error message.
Quote:

System unable to boot and I get "Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(0,0)

removed036 02-19-2019 03:57 PM

1 Attachment(s)
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 :(

colorpurple21859 02-19-2019 05:10 PM

this may help I know it is for opensuse, but some of the same drivers are used in different distros.
http://bruceblinn.com/linuxinfo/Conf...el-VMware.html

aRTee 08-18-2019 04:50 PM

Sorry to butt in here, but can it be that there is a mismatch with grub and the EFI settings in the boot/BIOS of the system (VM or whatever)?

I've had this error when the BIOS tried to boot a grub legacy configuration whilst the BIOS was going for an EFI type start.


All times are GMT -5. The time now is 02:46 AM.