How To Open A TrueCrypt Container Using cryptsetup

https://tails.boum.org/doc/encryption_and_privacy/truecrypt/index.en.html

https://wiki.archlinux.org/index.php/TrueCrypt#Accessing_a_TrueCrypt_container_using_cryptsetup

$ sudo cryptsetup --type tcrypt open container-to-mount container-name

examples:

for a fully encrypted drive:

$ sudo cryptsetup --type tcrypt open /dev/sdc1 files1

or for an encrypted file container

$ sudo cryptsetup --type tcrypt open /media/mydir/myfile files1

Replace ‘container-to-mount' with the device file under /dev or the path to the file you wish to open and ‘name' with a name of your choice. Upon successful opening, the plaintext device will appear as /dev/mapper/container-name (in the above example it would be ‘/dev/mapper/files1'), which you can mount like any normal device.

After typing your password and once the command prompt reappears, execute the following commands to mount the volume. Replace ‘name' with the name chosen above. If you do not already have a folder for the volume:

$ mkdir /media/[name]

mount the volume, replace ‘name' with the name you chose above (in this case it would be ‘files1'):

$ sudo mount -o uid=1000 /dev/mapper/[name] /media/[name]

To close your TrueCrypt volume, execute the following commands to safely remove it or some of your files could be lost or damaged. Replace [name] with the mapping name chosen above:

$ umount /media/[name]
$ cryptsetup close [name]

more…How to encrypt a partition:

https://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/

ERRORS & SOLUTIONS

If you are trying to unmount a drive ( or USB drive) and are seeing the error:

$ sudo umount /media/thedrive
umount: /media/thedrive: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)

Do this to kill the busy processes and unmount the drive (substitute sdXN with the correct drive info:

$  sudo fuser -kim /dev/sdXN

The output will show runing processes, example:

/dev/sdXN:            8933  9628c
Kill process 8933 ? (y/N) y

Press ‘y' to kill the process and do the same for the next prompt, then:

$ sudo umount dev/sdXN

or:

$ sudo umount /media/yourdrivename

3 thoughts on “How To Open A TrueCrypt Container Using cryptsetup

  1. Thanks for this posting, however i was not able to open truecrypt partitions which were for windows and were tc was in the boatloader i had to add –tcrypt-system for it to work

    cryptsetup open –type tcrypt –tcrypt-system /dev/sda4 windowspartition

    hope this helps somebody

    j

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.