Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # wipe the disk
- wipefs –a /dev/sda
- parted /dev/sda mklabel gpt
- parted /dev/sda mkpart logical ext4 0% 100%
- mkdir /mnt/usb
- cryptsetup luksFormat /dev/sda1 # type YES and then enter a password
- dd if=/dev/urandom of=/root/keyfile bs=1024 count=4
- chmod 0400 /root/keyfile
- cryptsetup luksAddKey /dev/sda1 /root/keyfile #Enter passphrase
- cryptsetup open /dev/sda1 encrypted
- # create new ext4 filesystem
- mkfs.ext4 /dev/mapper/encrypted
- echo encrypted /dev/sda1 /root/keyfile luks >> /etc/crypttab
- echo /dev/mapper/encrypted /mnt/usb ext4 defaults 0 2 >> /etc/fstab
- mount /mnt/usb
- # depending on your system, you may need to update your initramfs at this point
- reboot
Add Comment
Please, Sign In to add comment