Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tankmek
Created August 20, 2018 02:40
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 tankmek/38bbce410a4c588cdd20787fbc3a2183 to your computer and use it in GitHub Desktop.
Save tankmek/38bbce410a4c588cdd20787fbc3a2183 to your computer and use it in GitHub Desktop.
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:
/usr/share/mkinitrd/mkinitrd_command_generator.sh
## Troubleshooting
cryptsetup luksOpen /dev/sdx2 slackcrypt
vgscan --mknodes
vgchange -ay
lvscan
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
#eNd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment