Knowledge Base:Unable to mount root fs

Synopsis
When booting a freshly configured kernel, the boot fails with the following message:

VFS: Cannot open root device "hda3" or unknown-block(2,0) Please append a correct "root=" boot option; here are the available partitions: ... Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

The numbers in the  section can be different.

Environment
Any Gentoo Linux system on which a new kernel is being booted (or an update was made on the bootloader configuration).

Analysis
The panic informs that the Linux kernel is unable to:


 * 1) Detect the controller for the hard disk (a likely candidate if the message says  );
 * 2) Detect the partition because it does not have support for the partition type (less likely, but still possible);
 * 3) Mount the partition because it does not know how to access the file system (a likely candidate if the message gives a non-zero figure in the first number set, such as  );
 * 4) Detect the partition because the wrong device was passed in the boot loader configuration.

Resolution
Boot with the old kernel (if available), or with a LiveCD, and open the kernel configuration:


 * Ensure that the controller chipset has been configured in the Linux kernel (and in-kernel, not as a module);
 * Ensure that the used file systems (such as ext2, ext3, ext4, ReiserFS, Btrfs, etc.) are configured in the Linux kernel (and built into the kernel, not as a module);
 * If running Gentoo as a Qemu guest, ensure that the virtio block drivers and PCI driver for virtio devices are enabled in the kernel (that is,  and   in the kernel configuration file).

Also verify that the boot loader configuration ( for GRUB legacy and for GRUB2) refers to the correct partition: