knowledge/technology/linux/filesystems/LUKS.md
2023-12-04 11:02:23 +01:00

1 KiB

aliases obj
dm-crypt
filesystem

LUKS

a transparent disk encryption subsystem in the Linux kernel. It is implemented as a device mapper target and may be stacked on top of other device mapper transformations. It can thus encrypt whole disks (including removable media), partitions, software RAID volumes, logical volumes, as well as files. It appears as a block device, which can be used to back file systems, swap or as an LVM physical volume

Usage

Initialize device:

cryptsetup luksFormat device

Open device:

cryptsetup open device dmname

Device will be mapped in /dev/mapper/dmname

Close device:

cryptsetup close dmname 

Show device info:

cryptsetup luksDump device

Resize device:

cryptsetup resize device

Crypttab

Define crypto targets in /etc/crypttab

name   underlying device   passphrase              cryptsetup options
backup /dev/sdb1           /key/backup.key

After devices are unlocked they can be mounted using fstab.