Sunday, 15 December 2013

Create and configure LUKS-encrypted partitions and logical volumes to prompt for password and mount a decrypted file system at boot

Suppose a partition named /dev/sdb1 is available

Now we have to format it with luks
#cryptsetup luksFormat /dev/sdb1

Now partition needs to be labeled
#cryptsetup luksOpen /dev/sdb1 newname

Now format that partition with ext4 or ext3
#mkfs.ext4 /dev/mapper/newname

Now in /etc/crypttab enter
newname /dev/sdb1

Finally in fstab enter
/dev/mapper/newname /mountpoint ext4 defaults 1 2

or if permanent changes are not required then
#mount /dev/mapper/newname /mountpoint
#umount /mountpoint

No comments:

Post a Comment