Skip to content

Instantly share code, notes, and snippets.

@fishi0x01
Last active January 5, 2022 18:28
Show Gist options
  • Save fishi0x01/9f0ef40c3ce7009abe61e644e0622b84 to your computer and use it in GitHub Desktop.
Save fishi0x01/9f0ef40c3ce7009abe61e644e0622b84 to your computer and use it in GitHub Desktop.
Creating an encrypted drive with cryptsetup

Ensure to select the proper drive

fdisk -l
lsblk

Setup encryption

Assuming sdX is the device to encrypt

cryptsetup luksFormat --type luks2 /dev/sdX

Format device

Re-attach disk so mapper is created

mkfs.ext4 /dev/mapper/luks-xyz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment