Search This Blog

Sunday, July 31, 2011

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

2 comments:

Anonymous said...

Nice tutorial. I made one and used a similar method. Please check out my guide and let me know what you think.

http://www.linuxexplorers.com/2012/03/how-to-configure-a-luks-encrypted-partition-in-red-hat-enterprise-linux-rhel-rhcsa-objective/

Unknown said...

good one