Contents
How to mount and un-mount an encrypted disk?
To mount and un-mount the encrypted disk you must use systemctl rather than the usual mount and umount commands. Mount the disk with systemctl start mnt-data.mount, and un-mount with systemctl stop mnt-data.mount The systemd units are executed only after the network and the other “normal” filesystems are mounted.
How to use two passwords on one disk?
Instead of caching the key, you use the volume key of one disk as an additional password for the second disk. This requires adding a second password to the second (and third, etc) encrypted disk, but LUKS supports that.
How to encrypt the SDC1 partition using Luks?
Encrypt the sdc1 partition using LUKS, create an ext4 volume in that partition, and then close the encrypted volume. In all commands that require a keyfile, we’re invoking the /etc/luks/key.sh script that we created before, and telling cryptsetup to read the keyfile from stdin.
Why is my Disk not mounted in terminal?
However, the disk is not mounted and I can confirm this by opening the GUI of Disk Utility.app and also the disk does not show in the Finder. I suspect this is because the disk is encrypted and the terminal command is not passing via “Keychain” to retrieve the password for the encrypted disk.
How to auto mount a disk in systemd?
Note the StopWhenUnneeded=true line: this will make systemd stop the unit (including running the luksClose operation) automatically when the disk is unmounted. Create another systemd unit with the mountpoint for /mnt/data, and save it as /etc/systemd/system/mnt-data.mount.
How to unlock an encrypted drive in Linux?
Create a systemd unit for unlocking the encrypted device and save it as /etc/systemd/system/unlock-data.service. Make sure you replace the UUID in the command below! Note the StopWhenUnneeded=true line: this will make systemd stop the unit (including running the luksClose operation) automatically when the disk is unmounted.