I've seen on various Linux systems where instead of the real device node (for example: /dev/sda1
), the root device appears as /dev/root
, or instead of the real filesystem, mtab
says it is a filesystem called rootfs
(which appears as a real filesystem in /proc/filesystems
, but doesn't have code in <linux-kernel-source-tree>/fs
). Various utilities have been made to use certain attributes to determine the real root device node (such as rdev, and the Chromium OS rootdev). I can find no logical explanation to this other than reading somewhere that very-small embedded devices don't always have to have a /dev
device node for their root device. (Is this true, and if so, is that the answer to my question?) Why does mtab sometimes say /dev/root
(and I think I might have seen it say rootdev
once) instead of the real device node, and how can I make it always say the real device node? The kernel first mounts the root device following the root
parameter in the cmdline, then init/systemd
re-mounts it according to the fstab
, correct? If so, then I presume I noticed that init
maintains mtab
. If my theory is correct, how can I make init
write the real root device node to mtab
?/etc/mtab
is actually a symbolic link to /proc/mounts
, which would mean mtab
is maintained by the kernel. So how do I configure/patch a kernel to, instead of saying the root devices node path is /dev/root
, have mtab
contain the real device node?

- 665
3 Answers
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).

- 71,831
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

- 141
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.

- 13,589

- 56,709
- 26
- 150
- 232
-
I am not entirely sure if
/dev/root
is an artefact of RedHat based distributions. – Rui F Ribeiro Jul 11 '16 at 06:11 -
Well, my Debian 8 doesn't have
/dev/root/
. On an old CentOS it seems to be an actual device node instead of a symlink. – ilkkachu Jul 11 '16 at 09:22 -
1Well, OpenEmbedded's
base-files
recipe'sfstab
mentions/dev/root
, so it isn't just distros originating from Red Hat that are using it. – ack Nov 16 '16 at 14:03
mount
givesrootfs on / type rootfs (rw)
for initrd and/dev/root on / type ext2 (rw,relatime,block_validity,barrier,user_xattr)
for ext2 hard disk with this setup. – Ciro Santilli OurBigBook.com Jan 30 '19 at 15:47/dev/root
is used by some implementations of initramfs but not others - in these cases it is not due to the kernel. When not using an initramfs, it seems to be a placeholder value used by the kernel. (Maybe it could be removed in some later kernel version though). https://stackoverflow.com/questions/37310046/how-does-linux-kernel-create-dev-root-initramfs-query – sourcejedi Mar 08 '19 at 13:39