rootfs doesn't show in /proc/mounts - so does this mean the doc out of date? No. See Why is there no rootfs file system present on my system?
As of Linux v4.17, this kernel documentation is still up to date.
rootfs is always present; it cannot be unmounted. But a lot of the
time you cannot see it in /proc/mounts.
You can see rootfs if you boot into an initramfs shell. If your
initramfs is dracut
, as in Fedora Linux, you can do this by adding
the option rd.break
to the kernel command line. (E.g. inside the
GRUB boot loader):
switch_root:/# grep rootfs /proc/mounts
rootfs / rootfs rw 0 0
When dracut switches the system to the real root filesystem, you can
no longer see rootfs in /proc/mounts. dracut can use either
switch_root
or systemd
to do this. Both of these follow the same
sequence of operations, as specified in the linked kernel
doc.
The operation which hides rootfs is chroot
.
switch_root:/# cd /sysroot
switch_root:/sysroot# mount --bind /proc proc
switch_root:/sysroot# grep rootfs proc/mounts
rootfs / rootfs rw 0 0
switch_root:/sysroot# chroot .
sh-4.4# cat proc/mounts
/dev/sda3 / ext4 ro,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
[...]
initramfs
. In most PC distros, people still useinitramfs
wth some oldinitrd
filename at boot. – Mingye Wang Oct 26 '15 at 14:44