1

My /etc/fstab has only two lines: root partition and debugfs, while /etc/mtab has much more, in addition to these two, like (sysfs, proc, udev, devpts, tmpfs, cgroup, ...).

Where do the additional mount points come from?

1

Those mounts are often performed by the initramfs/initrd scripts or other early-boot system initialization scripts, or on distributions that are fully using systemd, by .mount systemd unit files executed by either the real systemd or by the mini-systemd environment within the initramfs.

For example, Debian 9 has the following .mount units by default:

/lib/systemd/system/dev-hugepages.mount
/lib/systemd/system/dev-mqueue.mount
/lib/systemd/system/proc-fs-nfsd.mount
/lib/systemd/system/proc-sys-fs-binfmt_misc.mount
/lib/systemd/system/run-rpc_pipefs.mount
/lib/systemd/system/sys-fs-fuse-connections.mount
/lib/systemd/system/sys-kernel-config.mount
/lib/systemd/system/sys-kernel-debug.mount
0

There is no requirement that partitions must be listed in /etc/fstab. After all, you can just run mount with everything explicitly specified in command-line arguments and mount another filesystem, without using anything from /etc/fstab.

However, what you are seeing are things that have been automatically mounted for you, already.

These days on Debian, most of these file systems (they are not partitions as there is no disk backing these file systems) are created/mounted by systemd.

Many of them are what the systemd people refer to as "API filesystems" because they effectively are part of the API that is provided by the kernel to applications. A list of such filesystems is hardwired into the systemd code. Observe that it is not in synch with the systemd documentation.

Mounting API filesystems is one of the usual tasks of the system management softwares that run as process #1, even outwith Linux, from BSD (sic!) init to systemd.

  • The API filesystems mounted by FreeBSD init are not documented, but like systemd can be found in its code.
  • The API filesystems mounted by runit-init on Debian and by van Smoorenburg rc are not documented. They can be found in a common rc script file, mountkernfs.sh, that both systems use. (Note that this is one of the van Smoorenburg rc scripts that systemd explicitly masks, because it is entirely spuerseded by what systemd does.)
  • The API filesystems mounted by the system-manager in the nosh toolset, both for Linux and for the BSDs, are listed in its manual page (q.v.) accessible with man system-manager.

Further reading

  • where are the systemd mount points defined? – Sparkler Sep 21 '18 at 17:42
  • Probably in the systemd source code. – RalfFriedl Sep 21 '18 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.