I have a backup drive that is Truecrypt Encrypted. I'd like to automnt this drive so I can automate backups when in the office. I am using Linux Mint 12 x64bit

I wrote a script that runs successfully with Sudo to mount the encrypted drive.

However, I can not get the drive to mount automatically...

I tried entering the script into rc.local, but that doesn't work.

So I tried editing the sudoers file (thinking I could enter this script into the startup applications area for Mint):

username ALL= NOPASSWD: /usr/local/bin/bakmnt.sh

*username is replaced with my real my username in the sudoers file

Still, when I try to run the script without sudo, I get:

Error: Failed to obtain administrator privileges.

I'm out of ideas, googling around seems to be an issue with Truecrypt..but I still come up empty for a solution. Any thoughts out there?

thanks for reading!!

  • Did you try putting the drive in /etc/fstab?
    – Kevin
    Commented Jan 19, 2012 at 21:45
  • I did not, as I understand it, there is no way to specify a password so the truecrypt partition will not mount under fstab. Commented Jan 19, 2012 at 21:54
  • so how do you supply password to mount it?
    – yrk
    Commented Jan 19, 2012 at 22:31
  • "Still, when I try to run the script without sudo, I get..." if you added yourself to the sudoers, you should be using sudo. I'm confused.
    – phemmer
    Commented Jan 19, 2012 at 23:24
  • @yarek, it's part of the bash script I wrote. Commented Jan 20, 2012 at 0:20

1 Answer 1


Using sudoers is crock upon hack upon kludge; don't do that. rc.local (or a separate file in init.d) is the correct place to do this. Capture the output of your script when run from there and determine why it is failing. That should give you information you need to fix the script so that it works from rc.local.

  • Okay, I accept that. Any guesses where the output would log for rc.local? It isn't working and I can find a log for it. Commented Jan 20, 2012 at 19:03
  • rc.local is run as a sh script, so you can do output redirection in there; bakmnt.sh > /tmp/foobar 2>&1
    – Kyle Jones
    Commented Jan 20, 2012 at 19:38
  • Bingo!!! I didn't realize you that rc.local ran as sh script, very cool. The problem was a permissions issue with my key file. Fixed that and we are all set...thanks a million!! Commented Jan 20, 2012 at 21:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .