Skip to content

Instantly share code, notes, and snippets.

@ibihim
Last active June 4, 2018 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibihim/7319295bc99924d8ac4b55913fbf0728 to your computer and use it in GitHub Desktop.
Save ibihim/7319295bc99924d8ac4b55913fbf0728 to your computer and use it in GitHub Desktop.
Encrypted Partition creation with cryptsetup
# Convert partition to LUKS format
sudo cryptsetup --verbose --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 4000 --use-random luksFormat /dev/sdd
# Gather information about newly encrypted partition
sudo cryptsetup luksDump /dev/sdd
# Map partition to device name
sudo cryptsetup luksOpen /dev/sdd secrets
# Gather information about new device
sudo dmsetup info secrets
# Partioning to ext4
sudo mkfs.ext4 /dev/mapper/secrets
# Mount partition
sudo mount /dev/mapper/secrets /mnt
# Unmount partition
sudo umount /mnt
# Close device
sudo cryptsetup luksClose secrets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment