Ubuntu – How to mount an EncFS volume at /media/username/mountpoint

encfsmountmountpoint

I am using Gnome EncFS Manager [1] on Ubuntu 13.10. If I create an encrypted folder (known as a stash) and an unencrypted mountpoint, both in the Home folder, it works. For example, ~/test-encrypted and ~/test-mountpoint.

However, I cannot create a mountpoint in the /media/myusername/ folder (where USB drives and the like are mounted).

I have tried:

  • mounting to a non-existent folder, e.g. /media/myusername/newfolder
  • creating a folder /media/myusername/createdfolder and selecting that as a mountpoint

Both result in the following error message, even though the mountpoint is empty or does not exist:

The mount folder is not empty.

Permissions for the folders are as follows:

/media$ ls -la
total 12
drwxr-xr-x 3 root root 4096 Dec 11 09:47 .
drwxr-xr-x 23 root root 4096 Dec 11 10:26 ..
drwxr-x---+ 5 root root 4096 Dec 17 10:29 username

/media$ cd username

/media/username$ ls -la
total 17
drwxr-x---+ 5 root root 4096 Dec 17 10:29 .
drwxr-xr-x 3 root root 4096 Dec 11 09:47 ..
drwxr-xr-x 2 username username 4096 Dec 11 09:49 attemptedmountpoint
drwxr-xr-x 19 username username 4096 Nov 22 11:52 workingmountpoint

Do I need set special permissions on the parent folder /media/myusername or on the new folder I want as a mountpoint? Or is there something else I should do?

[1] A GUI for EncFS mounting, currently installable via PPA from the link above.

Best Answer

Got an answer from the developer:

The message is misleading here. As you can see, you don't have write permissions in /media/username. That means that GEncfsM can't create the mount-points. To fix this use:

sudo chown username /media/username

It will then read:

drwxr-x---+ 5 username root 4096 Dec 17 10:29 username

...

If you want to put all mount-points per default there, you can then adjust the variable mount_dir_base in the advanced preferences to /media/$USER. GEncfsM has to be restarted after the change.

Related Question