4

I used the advice given at the end of this article to mount a TrueCrypt volume by double-clicking it. But I can't unmount it without opening TrueCrypt (umount: /media/truecrypt1 is not in the fstab (and you are not root)) so being able to mount it without opening the program is kind of a moot achievement. Any suggestions?

H3R3T1K
  • 2,401

4 Answers4

6

Suggestion One

You can use a terminal to unmount it.

For example, I have an encrypted file named enc1 that is on /home/desgua/Dropbox/, so to mount it I should use:

truecrypt --mount /home/desgua/Dropbox/enc1 /mnt/mymountpoint/

And to unmount:

truecrypt -d /home/desgua/Dropbox/enc1

or simple:

truecrypt -d (which should unmount every truecrypted mounted files)

.

Suggestion Two

Also you can create a launcher to unmount it:

1) Paste this at terminal: gedit ~/Desktop/unmounttruecrypt.desktop,

2) Then paste this into the file and save:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Unmount Truecrypt
Comment=Unmount all mounted Truecrypt files
Exec=gnome-terminal -e "bash -c \"truecrypt -d ; exit; exec bash\""
Icon=/usr/share/icons/Humanity/actions/48/player_eject.svg
Categories=Application;Accessories;

3) Now look at your desktop and drag the file to the Launcher.

.

Suggestion Three

Make a script to unmount it for you:

1) Paste this at terminal: gedit ~/Desktop/utscript,

2) Then paste this into the file and save:

#!/bin/bash
mnt=$(mountpoint /mnt/mymountpoint/) # See suggestion One

if [[ $mnt == "/mnt/mymountpoint/ is a mountpoint" ]]; then

    truecrypt -d /home/desgua/Dropbox/enc1 | zenity --progress --percentage=40 --auto-close --title="Unmounting" --text="I am umounting it now."
    sleep 2 | zenity --progress --percentage=100 --auto-close --title="Done!" --text="Done unmounting!" 
    else

    sleep 2 | zenity --progress --percentage=100 --auto-close --title="Already done!" --text="It is unmounted already!" 

    fi

exit 0  

4) Paste this at terminal: chmod +x ~/Desktop/utscript

desgua
  • 32,917
3

try adding it to the /etc/fstab. That worked for me.

/dev/mapper/truecrypt1 /media/truecrypt1  auto   rw,user 0      0
Ruediger
  • 2,182
  • Haven't tested it since I use LUKS, but it seems legit. – RobotHumans Apr 18 '12 at 02:03
  • I added the line to fstab. I now get this error: umount: only root can unmount /dev/mapper/truecrypt1 from /media/truecrypt1 which is weird since I did enter the root PW (same as admin) before I could mount the volume. – H3R3T1K Apr 19 '12 at 16:08
  • If you mount it as root only root can unmount it. Try to mount and unmount it as normal user. – Ruediger Apr 19 '12 at 17:22
  • Had a look into the user option again ... "Only the user that mounted a filesystem can unmount it again. If any user should be able to unmount, then use users instead of user in the fstab line. " Maybe it works better with the users option for you. – Ruediger Apr 20 '12 at 07:16
  • /dev/mapper/truecrypt1 /media/truecrypt1 auto rw,users 0 0 (users with an S) didn't help. I still need to enter admin pw upon mounting/unmounting. – H3R3T1K Apr 20 '12 at 09:39
  • OK, I tried again. When I mount the volume the first time via the GUI I need to enter the Admin pwd. Then I can mount and unmount the volume via command line without pwd.

    I had a look in the truecrypt docu http://www.truecrypt.org/docs/?s=security-model and it seems you need admin rights to mount truecrypt volumes (at least initially)

    – Ruediger Apr 20 '12 at 10:40
  • So it isn't possible to just click the unmount button in Nautilus to unmount the TrueCrypt volume? It does work now but when I open TrueCrypt, the volume is still shown mounted. – H3R3T1K Apr 20 '12 at 15:13
  • doesnt work for me, it still asks for root. – gravitation Feb 18 '13 at 22:49
0

If you're having unmount issues with TrueCrypt, try going to Settings > Preferences > System Integration and check 'Do not use kernel cryptographic services'.

Veazer
  • 1,431
0

Stop using your volume and make sure no other program's current working directory is on the volume. Then try:

umount -a

This will try to unmount all unused filesystems on your computer, including your TrueCrypt volume.

arg
  • 1