Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What I am trying to do is bind: /home/username/Dropbox/Documents to /home/username/Documents on startup. On another computer running Ubuntu 12.04 I did this by placing the following line in /etc/fstab:

/home/username/Dropbox/Documents /home/username/Documents auto bind

However, on this computer, I have an encrypted home folder, so fstab claims that the location does not exist on boot, asking me to skip mounting it or manually repair.

So my question is: how can I mount these folders only after I've logged into the user with the encrypted home folder?

share|improve this question
add comment

2 Answers 2

up vote 0 down vote accepted

Another option that might be of interest for you, would be symlinking it:

ln -s /home/username/Dropbox/Documents /home/username/Documents
share|improve this answer
    
I hadn't thought about this, is there a way to give the symlink the original Documents folder icon so you can't tell it's a symlink? Edit: I realized I didn't have to delete the folder first and can directly link to the folder still a bit new to ubuntu. lol –  fjrichman Jul 15 '12 at 22:31
add comment

Place this script in /home/username/bin.

mount-dropbox.sh:

#!/bin/bash
mount --bind /home/username/Dropbox/Documents /home/username/Documents

Add execution permission: chmod 755 /home/username/bin/mount-dropbox.sh

Edit sudoers file with sudo visudo and add the following line to its end:

username ALL = NOPASSWD: /home/username/bin/mount-dropbox.sh

Add sudo /home/username/bin/mount-dropbox.sh to the Startup Applications.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.