3

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?

4

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.

  • Intact when fstab runs and one of the partitions which is listed in there is missing, the OS (arch Linux in my case) would fail to load and fall back into a temporary shell to fix the problem. So fstab is only used to mount regularly used partitions at boot. – One Face Jan 22 '15 at 19:46
  • 1
    @CRags It doesn't "run" at all; it's not a program. It's used as a source of information by mount if you don't supply parameters. E.g., if you list a partition in fstab, you don't have to specify a mount point, you can just mount /dev/sdb11 or whatever, and the mount point and options from /etc/fstab will be used. – goldilocks Jan 22 '15 at 20:02
  • I meant when the instructions in fstab are run, meaning when partitions in fstab are mounted. Sorry for poor wording – One Face Jan 22 '15 at 20:04

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.