I’ve been trying to create an encrypted filesystem for quite some time now, I’ve not been able to do it since I’ve not known exactly what to look for.
Thing is, an encrypted filesystem (in Linux atleast) is not a filesystem like ext3, reiserfs etc. Rather, its a lower level mapping that creates an encrypted device on which we can create a filesystem of our choice.
Anyway, first create some free space (I had about 433 MB) and then create a partition on it (you don’t need to format it).
Do these as root:
sudo cryptsetup -c aes -h ripemd160 -b `sudo blockdev --getsize $DEV` create cryptvol1 $DEV
Replace $DEV with the device of your choice.. in my case /dev/sda8. It will ask you for your password. You might want to add a “-y” for it to ask for a password confirmation. This creates the encrypted device, with its unencrypted version on /dev/mapper/cryptvol1.
mount /dev/mapper/cryptvol1 /my/favourite/mountpoint
Next time you need to use the partition, you will need to do each step, excluding, of course, Step 3. To simplify things for myself I use a script.
So what do I use it for? Currently for credit card and banking passwords which cannot be stored reliably anywhere else.