[HOWTO] Automatically Unlock and Automount LUKS Encrypted Drives
Switch up to root
su - Password: xxxxx
Create a keyfile containing random data, make it readable onlly to root
dd if=/dev/urandom of=/root/keyfile bs=1024 count=4 chmod 0400 /root/keyfile
The following requires the crypto drive partition, X being the drive and Y the partition. ie: sda1
cryptsetup luksAddKey /dev/sdXY /root/keyfile
Enter the password to unlock the drive.
vi /etc/crypttab
and add an entry:
sdXY_crypt /dev/disk/by-uuid/247ad289-dbe5-4419-9965-e3cd30f0b080 /root/keyfile luks
vi /etc/fstab
and add an entry:
/dev/mapper/sdXY_crypt /media/sdXY ext3 defaults 0 2
reboot
Leave a Reply