Why on some Linux systems, does the root filesystem appear as /dev/root instead of /dev/<real device node>in mtab?
This is generally an artifact of using an initramfs.
From the kernel documentation (https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt)
What is rootfs?
Rootfs is a special instance of ramfs (or tmpfs, if that's enabled), which is always present in 2.6 systems. You can't unmount rootfs for approximately the same reason you can't kill the init process; rather than having special code to check for and handle an empty list, it's smaller and simpler for the kernel to just make sure certain lists can't become empty.
Most systems just mount another filesystem over rootfs and ignore it. The amount of space an empty instance of ramfs takes up is tiny.
Thus rootfs
is the root filesystem that was created for the initramfs, and can't be unmounted.
In regards to /dev/root
, I'm less certain on this, but if I recall correctly /dev/root
is created when using an initrd (not the same as an initramfs).
Gentoo has a patch that does exactly this (ensures the real root device is shown). You can find it here: https://lkml.org/lkml/2013/1/31/574
In Linux, /dev/root
, if present, is a symlink to the actual device created at boot time.
You either use readlink /dev/root
or cat /proc/cmdline
to see the root
parameter of the booted kernel, and thus find out the real device behind it.
From man dracut(8)
However, to continue with a successful boot, the objective is to locate your root volume and create a symlink /dev/root which points to the file system.