1

A system I didn’t setup, just maintain (Debian 10/Buster):

root@host:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/p100p1502lp1 4.0T 3.2T 667G 83% / none 24G 0 24G 0% /sys/fs/cgroup none 24G 0 24G 0% /dev tmpfs 24G 0 24G 0% /dev/shm tmpfs 24G 2.5G 22G 11% /run tmpfs 5.0M 0 5.0M 0% /run/lock none 24G 0 24G 0% /run/shm 

But:

root@host:~# cat /etc/fstab proc /proc proc defaults 0 0 none /dev/pts devpts rw,gid=5,mode=620 0 0 none /run/shm tmpfs defaults 0 0 

How can it be that there is a root partition, but no entry for it in /etc/fstab/?

2 Answers 2

4

Root partition not in fstab

Your root is configured on your kernel command line through the "root=..." and "rootflags=..." options. The /etc/fstab entry then overwrites those options while booting, but if you don't have an entry in /etc/fstab, then the system uses whatever was on the kernel command line

The root partition can be mounted without an /etc/fstab entry over initramfs, systemd or others.

Initramfs

During boot, the initramfs reads the root device from the kernel's boot parameters root= in the bootloader configuration

systemd

systemd can dynamically handle the root filesystem based on the boot parameters, without relying on /etc/fstab

Check this:

/boot/grub/grub.cfg for root=

sudo cat /proc/cmdline

The mount command only shows you whatever is listed in /etc/mtab. If you want to see all the mounts, you can do cat /proc/mounts. You can mount something without having it recorded in /etc/mtab by using the mount -n option.

The fact that /etc/mtab and /proc/mounts are not necessarily the same thing can be useful for the shutdown scripts, as it lets them only worry about unmounting the stuff that's listed in /etc/mtab.

sudo cat /etc/mtab | grep "root"

root filesystem not listed when executing mount

No entry in fstab but partition is mounted at bootup

How does Linux know to mount without /etc/fstab (Linux, systemd, boot, Linux kernel, initramfs, Unix)?

Root partition not in fstab

fstab

How is /etc/fstab accessed before root is mounted?

When installing linux, why do we need to mount our "root partition" to "/", and what does it do?

ArchLinux mounts filesystem with no entries in /etc/fstab

0
3

fstab lists things that the OS needs to mount at boot. It is not the complete list of all filesystems mounted. (It's also possible to list things in fstab and mark them as not automatically mounted.)

Technically, the root partition is mounted very early in boot because it is needed to complete the boot. It doesn't make sense to look in fstab for the root partition because you have to mount the root partition to look at fstab. It can be in fstab, but doesn't have to be, and if it is in there, it is only used for documentation and labeling. (I'm not even sure mount options for root in fstab are used, the OS would have to remount root for those to be effective.)

It is also possible to manually mount partitions with the mount command and automatically mount hotswap devices with udev and autofs, and these would also not be listed in fstab. (And there are many other possibilities too.)

So if you think fstab is the authoritative list of all mounted filesystems, you need to rethink that. :)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.