How to encrypt-decrypt an ext3 partition on Linux

  • 3053870
  • 21-Jul-2006
  • 27-Apr-2012


Novell SUSE Linux Enterprise Server 9


How to encrypt-decrypt an ext3 partition on Linux

This can be used for situations where the partition needs to be encrypted for transport of the drive just incase it gets lost.


To Encrypt:
1. modprobe loop_fish2
2. Create an ext3 partition
3. losetup -e twofish /dev/loop0 /dev/sda1 (or your partition you created) - At this point you will be prompted for a password that needs to be over 20 characters.
4. mkfs.ext3 /dev/loop0
5. mount -t ext3 /dev/loop0
6. umount
7. losetup -d /dev/loop0

Mount and decrypt:
1. modprobe loop_fish2 (If it has not been previously loaded)
2. mount -t ext3 /dev/sda1 -oencryption=twofish - You will be prompted for your password you set when you encrypted it.

If the encrypted mount point is required to automount on reboots:
1. On the new system copy the /etc/cryptotab file from the old machine to mount it via /etc/init.d/boot.crypto at startup.
2. Here is an example of what that file entry would look like:
/dev/loop0  /dev/sda1       /encrypt_part  ext3      twofish  defaults

NOTE: The encryption key is usually not saved anywhere but the user is prompted at startup for the right key.

Feedback service temporarily unavailable. For content questions or problems, please contact Support.