I want to bind mount a directory within my home when I log on. The line in fstab would be

/foo/bar /home/me/wherever none bind 0 0

The trouble is my home directory is encrypted, so it has to happen after I log in. The problem is my login scripts don't have permission to run mount.

Is there a way to do this?


Everything you need is already built into mount.

The user option will allow non-root users to mount it also add noauto to stop mount attempts during system startup.

/foo/bar /home/me/wherever none user,noauto,bind 0 0
  • Tried that. Nothing mounts, but it also doesn't interrupt the boot with an error as it did before. Will there be a log of this?
    – spraff
    Feb 2 '15 at 18:21
  • 1
    yeah, you have to add the command to mount it in your log-on script.
    – Jasen
    Feb 2 '15 at 22:22

super can run scripts setuid root. Try it. http://www.ucolick.org/~will/RUE/super/super.1.html.

  • 1
    Is there any reason to prefer super over sudo
    – Jasen
    Feb 2 '15 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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