Skip to content

Instantly share code, notes, and snippets.

@thbkrkr
Created September 29, 2018 20:30
Show Gist options
  • Save thbkrkr/8e819a7d779ca1f8797254829c319364 to your computer and use it in GitHub Desktop.
Save thbkrkr/8e819a7d779ca1f8797254829c319364 to your computer and use it in GitHub Desktop.
crypt
#!/bin/bash -eu
name=cslash device=/dev/nvme0n1p5
sudo cryptsetup -c aes-xts-plain64 --hash sha512 --key-size 512 luksFormat -v $device
sudo cryptsetup luksOpen $device $name
sudo mkfs.ext4 -m 0 /dev/mapper/$name
echo "$name $device none luks,timeout=30" | sudo tee -a /etc/crypttab
echo "/dev/mapper/$name / ext4 errors=remount-ro 0 1" | sudo tee -a /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment