How do I automatically bind mount on boot in a non-root encrypted home directory?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















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?










share|improve this question


























    1















    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?










    share|improve this question
























      1












      1








      1








      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?










      share|improve this question














      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?







      ubuntu mount fstab disk-encryption






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 1 '15 at 19:42









      spraffspraff

      2212615




      2212615




















          2 Answers
          2






          active

          oldest

          votes


















          2














          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





          share|improve this answer

























          • 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


















          0














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






          share|improve this answer


















          • 1





            Is there any reason to prefer super over sudo

            – Jasen
            Feb 2 '15 at 7:17











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f182350%2fhow-do-i-automatically-bind-mount-on-boot-in-a-non-root-encrypted-home-directory%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          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





          share|improve this answer

























          • 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















          2














          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





          share|improve this answer

























          • 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













          2












          2








          2







          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





          share|improve this answer















          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






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 2 '15 at 7:20

























          answered Feb 2 '15 at 7:11









          JasenJasen

          2,210813




          2,210813












          • 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

















          • 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
















          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





          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




          1





          yeah, you have to add the command to mount it in your log-on script.

          – Jasen
          Feb 2 '15 at 22:22





          yeah, you have to add the command to mount it in your log-on script.

          – Jasen
          Feb 2 '15 at 22:22













          0














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






          share|improve this answer


















          • 1





            Is there any reason to prefer super over sudo

            – Jasen
            Feb 2 '15 at 7:17















          0














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






          share|improve this answer


















          • 1





            Is there any reason to prefer super over sudo

            – Jasen
            Feb 2 '15 at 7:17













          0












          0








          0







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






          share|improve this answer













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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 1 '15 at 21:32









          Nizam MohamedNizam Mohamed

          42536




          42536







          • 1





            Is there any reason to prefer super over sudo

            – Jasen
            Feb 2 '15 at 7:17












          • 1





            Is there any reason to prefer super over sudo

            – Jasen
            Feb 2 '15 at 7:17







          1




          1





          Is there any reason to prefer super over sudo

          – Jasen
          Feb 2 '15 at 7:17





          Is there any reason to prefer super over sudo

          – Jasen
          Feb 2 '15 at 7:17

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f182350%2fhow-do-i-automatically-bind-mount-on-boot-in-a-non-root-encrypted-home-directory%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown






          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)