Yes you can do that. I use an external harddrive and mount it on my Ubuntu installations with cryptsetup
/dm-crypt
. But you need to update your cryptsetup packages to version 1.6 to get this functionality. I used this PPA on older Ubuntu releases.
Mounting a container is no different from mounting an encrypted partition as one would expect:
$ sudo cryptsetup tcryptOpen testcontainer.tc testcontainer
Now a new disk shows up in Nautilus or the launcher and you can mount it via Nautilus or terminal if you like. I mounted the container via Nautilus.
$ mount | grep testcontainer
/dev/mapper/testcontainer on /media/livewire/F29F-27D2 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
Don't forget to unmount the filesystem and the container itself after unmounting the filesystem:
$ sudo cryptsetup tcryptClose /dev/mapper/testcontainer
While a GUI only solution to mount such containers and partitions the same way you can mount LUKS partitions would be more comfortable, it is currently not possible as it seems.
Automounting via pam_mount also seems to be not possible at the moment.
sudo cryptsetup tcryptOpen testcontainer.tc testcontainer
give mecryptsetup: Unknown action.
– oshirowanen Feb 28 '14 at 21:27cryptsetup 1.4.1
installed. Is that version too old? – oshirowanen Mar 01 '14 at 10:16