Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using encfs and I've been quite happy with it so far, but I have one issue that can be somewhat annoying.

Say my favourite mount point is ~/encfsmnt. My problem is that if my encfs isn't mounted yet that is non-obvious. I may wind up happily writing into the directory ~/encfsmnt, instead of the data being encrypted by encfs into the encfs lower directory.

The obvious way to fix this would be to set the file mode of ~/encfsmnt to, say, 400 (dr--------), but apparently encfs requires that the mount point directory be writable for the mount to be successful (I get a "fusermount: user has no write access to mountpoint" error message).

Is there any way to make my mount point unwritable unless encfs is actually mounted to it?

share|improve this question
up vote 4 down vote accepted

I am afraid either it is writable or not. In order to make it writable for a certain process (fusermount) only you probably need an LSM (Apparmor, SELinux or similar). This requires root access, of course.

The easier solution might be to integrate chmod u+w ~/encfsmnt into the fusermount call (if you don't have a GUI do that for you). Create a small script which does that after calling fusermount (and deletes write access after umount).

Or change the mountpoint: Make ~/ the mountpoint (if that is possible, otherwise get used to write to a different target). Within the mounted ~/ you create a directory where all your (new) stuff goes to: ~/ You create the same directory in the unmounted ~/ But you write protect that one.

Then you make ~/encfsmnt a symlink to ~/ If unmounted, the directory is write protected, if mounted it is writable. This doesn't work, of course, if you cd into that directory.

Hmm, interesting idea: Does fusermount work if ~/encfsmnt has write right but no execute right?

share|improve this answer
Execute rights are needed ("fusermount: failed to chdir to mountpoint: Permission denied"). But I like the idea of having a subdirectory that has 000 permissions in the unmounted directory. I just need to use "-o nonempty" to encfs to force the mount and I essentially have what I need, thanks! – Quantumboredom Feb 11 '13 at 22:16

Your Answer


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.