How to mount an encrypted TrueCrypt partition always in the same point

mountpartitiontruecrypt

I just formatted my external HD and divided it in two partitions: an ext4 where important information will be, and a ntfs for "compatibility" things (i.e. movies, music, etc).

I encrypted the ext4 partition with TrueCrypt but now I'm facing a problem I hadn't before: instead of mounting in /media/DATA/ it is mounting in /media/truecryptX, where X is the number of virtual device selected in TrueCrypt.

I know that if I always mount the partition as device 1, the mount point will be always /media/truecrypt1/, but I would like to have some other point more "meaningful" like /media/DATA/. For example the ntfs partition is always mounted as /media/DATANTFS/ because it isn't encrypted.

Best Answer

If you use TC GUI, you should set some favorite volumes -- you can read more about it here. It's simple. First you have to mount your volumes one by one and specify mount points:

enter image description here

Then you just add them to favorites:

enter image description here

The more you add, the bigger will be the list of favorite volumes:

enter image description here

Next time you want to mount them, you just have to use Favorites menu:

enter image description here

Or if you want to use a terminal, just type the following line:

$ truecrypt --auto-mount=favorites

It will mount all the favorite volumes you have on the list.

If you want to do it as a normal user, you can add that user to truecrypt group:

# groupadd truecrypt
# adduser user truecrypt

and set an appropriate entry in sudo config file:

# Users in the truecrypt group are allowed to run TrueCrypt as root.
%truecrypt ALL=(root) NOPASSWD:/usr/bin/truecrypt

You should consider using LUKS instead. It's a way easier to configure every aspect of encrypted volumes.

Related Question