Skip to content

Instantly share code, notes, and snippets.

Created August 20, 2018 02:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Notes on setting up LUKS/LVM before Slackware install.
# Create 100MB boot partition (Linux)
# Make the rest of the space one unit not bootable
## Make cryptanalysis harder
dd if=/dev/urandom of=/dev/sda2
# Setup luks container
#cryptsetup --verbose --cipher aes-xts-plain64:sha512 --key-size 512 --hash sha512 --iter-time 5000 luksFormat
cryptsetup -s 256 -y luksFormat /dev/sdx2
cryptsetup luksOpen /dev/sdx2 slackcrypt
# create physical volume
pvcreate /dev/mapper/slackcrypt
vgcreate cryptvg /dev/mapper/slackcrypt
# create logical volumes
lvcreate -L 16G -n swap cryptvg
lvcreate -L 200G -n home cryptvg
lvcreate -l 100%FREE -n root cryptvg
vgscan --mknodes
vgchange -ay
# Initialize swap
mkswap /dev/cryptvg/swap
# Just use this:
## Troubleshooting
cryptsetup luksOpen /dev/sdx2 slackcrypt
vgscan --mknodes
vgchange -ay
mount /dev/cryptvg/root /mnt
mount /dev/sda1 /mnt/boot
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
mount -o bind /dev /mnt/dev
chroot /mnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment