Kernel and QEMU : Unable to mount root fs error

14,713

I don't think you would have to start debugging the kernel right away. This error message means that the kernel is unable to mount the partition you requested to be /. This would happen for example if you gave it an empty disk image (my hunch is this is your case) - the kernel in the VM sees an unpartitioned drive, there is no /dev/sda1 just /dev/sda. To overcome this follow the instructions in the guide you have used - download a bootable ISO image and use it to install system into the VM image. When raw disk image is used, it can be directly partitioned with utilities like gdisk, fdisk or parted.

Another possibility is, that there you are trying to mount a filesystem for which the kernel doesn't have a driver. This usually happens when one uses a kernel, that has most drivers in loadable modules on initrd and the initrd isn't loaded (hence the kernel lacks the ability to understand the particular filesystem).

Share:
14,713

Related videos on Youtube

PaulDaviesC
Author by

PaulDaviesC

Ruby On Rails Developer @ milaap.org | Wannabe Linux Kernel Hacker

Updated on September 18, 2022

Comments

  • PaulDaviesC
    PaulDaviesC over 1 year

    I am trying to run a distro in the virtual disk image with a custom kernel,so that I can experiment and debug the kernel. I followed this to make a disk image and then install Debian to it. Now I tried running distro with the following command:-

    qemu-system-i386 -hda debian.img -kernel ../linux-3.6.11/arch/i386/boot/bzImage -append "root=/dev/sda1"
    

    To my dissappointment it simply gives a Kernel panic-not syncing:VFS:unable to mount root fs on unknown-block(8,1). How can I fix the problem?Am I on the right path as far as kernel debugging is concerned?

  • PaulDaviesC
    PaulDaviesC over 11 years
    I have installed debian to the hard disk image debian.img. And the kernel do says that it has identified the partition sda,sda1,sda2,and sda5. If the problem is of the driver,any idea how could I fix it?
  • peterph
    peterph over 11 years
    @PaulDC Try to boot another kernel. If you made a full installation of Debian, I would expect it having installed the kernel as well. Hence it should be possible to bring up the VM without the -kernel option at all, since the VM BIOS should be able to boot the installed system right away as a real BIOS would do - by loading bootloader from MBR (or EFI partition, although the UEFI support in Qemu/KVM is still rather new AFAIK).
  • psusi
    psusi about 11 years
    Yep, forgot to load the initrd.