Mounting an Encrypted LUKS Volume
It’s really easy. Let’s assume sdb2
is the encrypted LUKS device (because it is for me). lsblk
shows the tree as this.
sdb 8:16 1 29G 0 disk ├─sdb1 8:17 1 2.5G 0 part └─sdb2 8:18 1 26.5G 0 part
Open the LUKS container with
cryptsetup open /dev/sdb2 luks_volume
(where luks_volume
is the unimaginative name of the container).
Now lsblk
should show something like
sdb 8:16 1 29G 0 disk ├─sdb1 8:17 1 2.5G 0 part └─sdb2 8:18 1 26.5G 0 part └─luks_volume 254:0 0 26.5G 0 crypt
and we just have to mount it.
mkdir /mnt/secrets/ mount /dev/mapper/luks_volume /mnt/secrets/
That’s it. When done,
umount /mnt/secrets cryptsetup close luks_volume rm -r /mnt/secrets/
to remove the mapping and mount point and clear the key from memory.