Does fstab actively run to detect new filesystems and mount them

automountingfstabmount

I'm creating an encrypted filesystem with LUKS. Inside of it is a single BTRFS filesystem.

If I add the UUID (and subvolume) of the filesystem to /etc/fstab, will the filesystem automatically be mounted when the LUKS container is decrypted? Specifically, in my file manager GUI, the disk shows up under "Devices." If I use my file manager GUI to decrypt the disk, will the newly-decrypted disk get picked up by /etc/fstab before the file manager attempts to mount it manually?

How "live" is mount and /etc/fstab?

Best Answer

No. /etc/fstab is consulted when mount is called. It's just a text file. It's also used implicitly by the init system at boot time, most likely via mount -a:

-a, --all

Mount all filesystems (of the given types) mentioned in fstab (except for those whose line contains the noauto keyword).

From man 8 mount.

Note that if you have some kind of automounting software running, it should consult /etc/fstab, although it might not since this is behaviour coded into the mount command but not the mount() system call.

Related Question