Dark-Fx.com

debian: loop-aes
2007-04-23 20:22:26 posted by Dark-Fx
Okay, so we're going to install loop-aes the debian way.

First we need to install some packages:
sudo apt-get install linux-headers-`uname -r` module-assistant loop-aes-source loop-aes-utils

Now, build the module with module assistant:
sudo module-assistant prepare
sudo module-assistant build loop-aes
sudo module-assistant install loop-aes

Now we want to remove the current loop module and insert the new one:
sudo rmmod loop
sudo modprobe loop

My preferred method is to use a small file on an existing partition and mount it seperately:
dd if=/dev/zero of=/volume bs=1k count=1M

This gives us a 1GB file named /volume. I prefer using AES256 so we're going to mount the loopback file here, and write an ext3 partition to it. It will ask you for a password which has to be 20 chars or longer.
losetup -e AES256 /dev/loop0 /volume
mkfs -t ext3 /dev/loop0

Great. Now we have an encrypted file system. Lets unmount the loop:
losetup -d /dev/loop0

And to mount the file system normally, remember to use the password:
mount volume -o loop=/dev/loop0,encryption=AES256 /mnt/secure/ -t ext3

Now, we want the module to load on bootup. Add this line to /etc/modules:
loop
And that's it! Piece of cake.