Doubts About the Linux Root File System
Solution 1:
The mount
command takes information about current mounts from /etc/mtab
.
In the past, mtab
was a normal file re-created after every boot and updated by the mount
command – so it wouldn't have a rootfs /
entry simply because the rootfs is never explicitly mounted; it just always exists. (Such a mtab
sometimes also has duplicate entries, or entries for filesystems that aren't mounted anymore...)
Many current distros now symlink mtab
to /proc/self/mounts
, which (like everything else in /proc) is directly generated by the kernel. Because of this, it always shows everything that is currently mounted, including both rootfs /
and /dev/blah /
.
You can use cat /proc/self/mounts
on all distros to compare the mounts. (There also is /proc/self/mountinfo
, which uses an incompatible syntax but adds more detail.)