Skip to content

Instantly share code, notes, and snippets.

@cupracer
Created May 11, 2016 17:28
Show Gist options
  • Save cupracer/fb9fca4c5bc8560815113702a93907ab to your computer and use it in GitHub Desktop.
Save cupracer/fb9fca4c5bc8560815113702a93907ab to your computer and use it in GitHub Desktop.
Create encrypted volume with keyfile
dd if=/dev/urandom of=myvolume.key bs=1 count=2048
cryptsetup luksFormat -c aes-cbc-essiv:sha256 -s 256 /path/to/myvolume
cryptsetup luksAddKey /path/to/myvolume myvolume.key
cryptsetup luksRemoveKey /path/to/myvolume
cryptsetup luksDump /path/to/myvolume
cryptsetup luksOpen -d myvolume.key /path/to/myvolume myvolume_enc
mkfs.ext4 /dev/mapper/myvolume_enc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment