Sunday 16 Feb 2025


LUKS Quick Unlock Guide


Image copyright

I want to write a quick reference for the use of LUKS. LUKS is an encryption tool for linux to protect drive paritions.

The command-line approach to open the container is as follows:

  • Get partition name through fdisk -l command; imporant, instead of sdd, you need to use sdd1
  • Use the cryptsetup tool to manage this
  • To create a map of the device, use:
    • cryptsetup luksOpen /dev/sdd1 encrypted_drive
  • This will create a link between sdd1 and mapper; you can use any name you wish, but for this example I used encrypted_drive. You will need to enter your passphrase after the command is executed.
  • Now, you need to mount the device:
    • mount /dev/mapper/encrypted_drive /mnt/drive

I use this tool to encrypt my external drives, replacing ecryptfs.

When finished, unmount the drive.

  • System unmount first:
    • umount /mnt/drive
  • And the encrypted mapper:
    • cryptsetup luksClose encrypted_drive

Here's a full guide to setup and LUKS container.


Backlinks:
index
Journal:Index
Journal:2025:02