All of the following commands must be run as root or with sudo
.
cryptsetup luksFormat <device>
Where <device>
might be /dev/sdb1
cryptsetup luksFormat <device> /path/to/keyfile
crypstetup open <device> <name>
mount /dev/mapper/<name> /mnt
<name>
may be any name, e.g. root
or data
cat <keyfile> | cryptsetup open <device> <name>
Removes the mapping and wipes the key from kernel memory.
umount /mnt
cryptsetup close <name>