cryptsetup - bunnyamin/bunnix GitHub Wiki

LUKS (Linux Unified Key Setup)

Create a Luks device file

  • cryptsetup luksFormat <DEVICE NAME>
  • Open the device
  • Format a filesystem mkfs.ext4 /dev/mapper/<DEVICE NAME>
WARNING!
========
This will overwrite data on pagefile irrevocably.

Are you sure? (Type 'yes' in capital letters):

Open and close Luks device

  • cryptsetup open --type luks <PATH TO DEVICE> <DEVICE NAME>
  • cryptsetup close --type luks <PATH TO DEVICE NAME>
  • Old syntax cryptsetup luksOpen <PATH TO DEVICE> <DEVICE NAME>

Backup

  • Dump header info $ cryptsetup luksDump <device, file>.
  • Back up header $ cryptsetup luksHeaderBackup <device, file> --header-backup-file <path>.
⚠️ **GitHub.com Fallback** ⚠️