Skip to content

Instantly share code, notes, and snippets.

Embed
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:
/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