Command disabled: index

Encrypted USB Disk on Ubuntu Linux and Windows

This sounds crazy, but: Howto encrypt a USB disk with Ext3 filesystem and use it in (Ubuntu) Linux and Windows.

There is nearly no way to destroy your data more safely than encrypting it and forgetting the password. None of the described tools provide any warranty. Use Windows at your own risk.

This HowTo is based on dm-crypt and especially on the tutorial at http://www.saout.de/tikiwiki/tiki-index.php?page=EncryptedDevice by William Owen Smith.

Howto Encrypt the Drive

  • Install the cryptsetup package (e.g with synaptics)
  • Insert the kernel module and add it to your default modules with:
sudo -s
modprobe dm_crypt
echo "dm_crypt" >> /etc/modules
  • If your drive isn't partitioned already, partition it now, e.g. with the gparted partition manager.
sudo gparted
Do not encrypt the whole drive, just the partition! Otherwise your system won't be able to read the partition table…
  • Unmount the partition you want to encrypt. Remember the name of the partition (e.g. /dev/sdc1). I'll call this <partition> from now on.
  • If you want it secure, you should check if the disk is okay and initialize the disk with random data. You can do both steps with this command:
/sbin/badblocks -c 10240 -s -w -t random -v <partition>
  • Encrypt the partition now. Remember, it has to be unmounted before. It will ask for a password for the encryption. If you want to mount the partition in windows, I think you have to use the AES encryption, which should be the default for this command:
sudo cryptsetup luksFormat <partition>
  • Open (i.e. “map”) the new partition, choose a name for it. I'll call it <crypt_partition> here.
sudo cryptsetup luksOpen <partition> <crypt_partition>
  • Format the new encrypted partition. For an USB stick, I would recommend to use Ext2 or VFAT. Note that Ext2 and Ext3 file systems will need a special driver on Windows (see below), which might be not as fast as NTFS on Windows.
sudo mkfs.ext2 /dev/mapper/<crypt_partition>
  • You can now put data into your encrypted partition like on any other partition. Since we have opened the encrypted partition with luksOpen, the partition will be unlocked until you execute
sudo cryptsetup luksClose <crypt_partition>.
  • On newer Linux Distributions, everytime you plug in the encrypted drive it will prompt you for a password and mount it automatically. The luksClose and unmount stuff will be handled automatically by your Desktop.

Howto Mount Ext3 and Ext2 Filesystems in Windows

Before we can mount our encrypted disk with Ext3 on Windows, we need to install an Ext2/3 driver. One good driver is Ext2IFS, which works on (nearly?) all Windows versions.

Ext2IFS

Among other, smaller limitations, the driver does not support permissions/access rights in any way. FAQ

  • Download and install the driver from http://www.fs-driver.org/. When it asks you to assign drive letters, enable the option that it assigns drive letters for removable drives automatically.
Inodes that are larger than 128 bytes are not supported by the Windows ext2 driver.
However, Ubuntu 8.10 and later seems to create ext3 partitions with 256 byte inodes by default!

Explore2fs

I haven't tested this yet, but if you do not use Windows Vista, http://www.chrysocome.net/explore2fs might be an option too.

Howto Mount Encrypted File Systems in Windows

Note: The Portable Mode is also very handy for an external drive. This driver is able to do lots of other encryption stuff, but I was only interested in mounting LUKS filesystems.

  • Start the FreeOTFE program and go to FileLinux Volume…Mount Partition… and select your encrypted partition.
devlog/blog/encrypted_usb_disk_on_ubuntu_linux_and_windows.txt · Last modified: 2009/05/09 12:08 by x4
Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! DevLog Atom feed Valid XHTML 1.0