How to mount an encrypted data disk in systemd?
In the systemd will not actually mount the directory until the first time it is accessed, e.g. ls /media/crypt-data, then it will mount just-in-time and appear thereafter in /proc/mounts. You may ask “*why have an encrypted data disk with the key in the root file system?”.
Why is my encrypted LVM volume won?
I think this (not having the crypt target) maybe causing the crypttab configuration to be ignored at boot-time and thus trying to mount the entry in fstab fails because cryptsetup has not mapped my encrypted volume to /dev/mapper/safe_vault. The encrypted volume can successfully be manually mapped, mounted and written:
Is it possible to mount a partition via systemd?
It seems that @Mikhail Morfikov’s answer covers mounting during the initramfs stage. An alternative (if it is not the root filesystem) is to decrypt and mount the partition automatically via systemd, after the linuz kernel is loaded. Of course this is only possible if you are running systemd.
Why does my LVM volume won’t Mount at boot time?
Why my encrypted LVM volume (LUKS device) won’t mount at boot time? Everything is setup but mounting the encrypted volume fails at boot-time with the error: fsck.ext4: No such file or directory while trying to open /dev/mapper/safe_vault Possibly non-existent device? What I’ve done…
Why do I need to install cryptsetup in Debian?
The sda2 UUID goes to /etc/crypttab and the volume UUID (for example debian_crypt-root) goes to /etc/fstab . After changing the /etc/crypttab file, you have to rebuild initramfs: The package cryptsetup has to be installed because it has startup scripts which provide support for automounting encrypted volumes at boot.
What does X-automount do in cryptsetup?
Here x-systemd.automount is an instruction to systemd to mount /media/crypt-data, and [email protected] is an instruction to systemd that decryption of crypt2 is required before that is possible.