Re: VFS: Cannot open root device

"Xi Ruoyao" ([email protected] via blfs-support Mailing List) <[email protected]> Mon, 08 Sep 2025 09:23:50 +0800
Newsgroups gmane.linux.lfs.beyond.support
Message-ID <[email protected]>
On Fri, 2025-09-05 at 19:25 +0800, Xi Ruoyao wrote:
> On Fri, 2025-09-05 at 11:15 +0000, Cliff mcDiarmid wrote:
> > Hello
> > 
> > I've never had any issue so far recompiling the kernel for LFS.   Still
> > there's always a first.
> > 
> > After enabling some modules in an existing kernel(6.12.5) I get the following
> > error when rebooting:
> > 
> > VFS: Cannot open root device
> > "/dev/nvme0n1p4" or unknown block (0,0): error -6
> > Please append a correct "root=" boot option
> > List of of all bdev filesystems  etc etc
> 
> Here the lines you replaced with "etc etc" are important, look at them
> carefully.  We enabled DRM panic and VESA framebuffer in LFS
> specifically to make the kernel able to show them clearly on such a
> "cannot open root device."

For example in one of my VM I can have this as the "etc etc":

VFS: Cannot open root device "/dev/sda2" or unknown-block(0, 0): error -6
Please append a correct "root=" boot option; here are the available partitions:
fe00        41943040 vda
 driver: virtio_blk
  fe01:         1024000 vda1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

  fe02:        41838592 vda2 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy

List of all bdev filesystems:
 ext3
 ext4

So we can see the issue is I should use "vda2" instead of "sda2" as
that's how the virtio devices are named.

> Possibilities are you incorrectly changed CONFIG_EXT4 to M, incorrectly
> changed CONFIG_NVME to M, incorrectly turned off CONFIG_EFI_PARTITION,
> or you have two NVME disks and their numbering changed between two
> boots.

So for e.g. if you incorrectly changed CONFIG_EXT4 to M, ext4 won't show
up in "list of all bdev filesystems"; if you incorrectly changed
CONFIG_NVME to M, you'd not see the disks and partitions at all; if you
incorrectly turned off CONFIG_EFI_PARTITION, you can only see the disks
but not partitions; if it happens the numbering of NVME disks changed,
you can just see the difference from the partition list.

Thus the info is very useful for diagnostic.

-- 
Xi Ruoyao <[email protected]>

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-support
Unsubscribe: See the above information page