Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 1.23 KB

File metadata and controls

31 lines (26 loc) · 1.23 KB

LVM and LUKS

Unlock second hard drive using keyfile

  1. sudo dd if=/dev/urandom of=/root/keyfile bs=1024 count=4
  2. sudo chmod 0400 /root/keyfile
  3. sudo cryptsetup luksAddkey /dev/sdX /root/keyfile
  4. edit /etc/crypttab
    • sdX_crypt /dev/sdX /root/keyfile luks
    • sdX_crypt /dev/disk/by-uuid/UUID_GOES_HERE /root/keyfile luks
  5. edit /etc/fstab
    • /dev/mapper/sdX_crypt /media/sdX ext4 defaults 0 2
  6. Because we edited /etc/crypttab we have to: sudo update-initramfs -u -k all
  7. Validate /etc/fstab: sudo mount -a

References