Get fsck to work with pam_mount

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











up vote
0
down vote

favorite












I've been trying to get luks volumes mounted at login with pam_mount fscked on mount, but without success.



fstab provides the sixth field, where one can set a flag to determine whether the volume should be fscked on mount, and its priority. I'd like to set my luks partition, which is mounted with pam_mount to be fscked too.



/etc/security/pam_mount.conf.xml has in it the following:



<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />


However, as far as I can tell fsck is not an option to mount. Indeed, if I include fsck in the options=... given to the <volume ... /> statement in /etc/security/pam_mount.conf.xml, my volume does not get mounted at login.



<volume user="user" fstype="crypt" path="/dev/sda2" mountpoint="/mnt/myvolume" options="defaults,fsck" />


The man page for pam_mount.conf lists fsck among auxiliary programs for which special default parameters should be specified. In particular, for fsck:



<fsck>fsck -p %(FSCKTARGET)</fsck>
Local volumes will be checked before mounting if this program is set.


But, I couldn't figure how to use this info. I'm not sure where the <fsck>...</fsck> statement should go, or whether %(FSCKTARGET) is an internal variable to pam_mount or something I should specify directly.



What is the proper way to get volumes mounted with pam_mount to get fscked on mount?










share|improve this question

























    up vote
    0
    down vote

    favorite












    I've been trying to get luks volumes mounted at login with pam_mount fscked on mount, but without success.



    fstab provides the sixth field, where one can set a flag to determine whether the volume should be fscked on mount, and its priority. I'd like to set my luks partition, which is mounted with pam_mount to be fscked too.



    /etc/security/pam_mount.conf.xml has in it the following:



    <mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />


    However, as far as I can tell fsck is not an option to mount. Indeed, if I include fsck in the options=... given to the <volume ... /> statement in /etc/security/pam_mount.conf.xml, my volume does not get mounted at login.



    <volume user="user" fstype="crypt" path="/dev/sda2" mountpoint="/mnt/myvolume" options="defaults,fsck" />


    The man page for pam_mount.conf lists fsck among auxiliary programs for which special default parameters should be specified. In particular, for fsck:



    <fsck>fsck -p %(FSCKTARGET)</fsck>
    Local volumes will be checked before mounting if this program is set.


    But, I couldn't figure how to use this info. I'm not sure where the <fsck>...</fsck> statement should go, or whether %(FSCKTARGET) is an internal variable to pam_mount or something I should specify directly.



    What is the proper way to get volumes mounted with pam_mount to get fscked on mount?










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I've been trying to get luks volumes mounted at login with pam_mount fscked on mount, but without success.



      fstab provides the sixth field, where one can set a flag to determine whether the volume should be fscked on mount, and its priority. I'd like to set my luks partition, which is mounted with pam_mount to be fscked too.



      /etc/security/pam_mount.conf.xml has in it the following:



      <mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />


      However, as far as I can tell fsck is not an option to mount. Indeed, if I include fsck in the options=... given to the <volume ... /> statement in /etc/security/pam_mount.conf.xml, my volume does not get mounted at login.



      <volume user="user" fstype="crypt" path="/dev/sda2" mountpoint="/mnt/myvolume" options="defaults,fsck" />


      The man page for pam_mount.conf lists fsck among auxiliary programs for which special default parameters should be specified. In particular, for fsck:



      <fsck>fsck -p %(FSCKTARGET)</fsck>
      Local volumes will be checked before mounting if this program is set.


      But, I couldn't figure how to use this info. I'm not sure where the <fsck>...</fsck> statement should go, or whether %(FSCKTARGET) is an internal variable to pam_mount or something I should specify directly.



      What is the proper way to get volumes mounted with pam_mount to get fscked on mount?










      share|improve this question













      I've been trying to get luks volumes mounted at login with pam_mount fscked on mount, but without success.



      fstab provides the sixth field, where one can set a flag to determine whether the volume should be fscked on mount, and its priority. I'd like to set my luks partition, which is mounted with pam_mount to be fscked too.



      /etc/security/pam_mount.conf.xml has in it the following:



      <mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />


      However, as far as I can tell fsck is not an option to mount. Indeed, if I include fsck in the options=... given to the <volume ... /> statement in /etc/security/pam_mount.conf.xml, my volume does not get mounted at login.



      <volume user="user" fstype="crypt" path="/dev/sda2" mountpoint="/mnt/myvolume" options="defaults,fsck" />


      The man page for pam_mount.conf lists fsck among auxiliary programs for which special default parameters should be specified. In particular, for fsck:



      <fsck>fsck -p %(FSCKTARGET)</fsck>
      Local volumes will be checked before mounting if this program is set.


      But, I couldn't figure how to use this info. I'm not sure where the <fsck>...</fsck> statement should go, or whether %(FSCKTARGET) is an internal variable to pam_mount or something I should specify directly.



      What is the proper way to get volumes mounted with pam_mount to get fscked on mount?







      mount pam luks fsck






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 19 mins ago









      gusbrs

      1366




      1366

























          active

          oldest

          votes











          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',
          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%2f479511%2fget-fsck-to-work-with-pam-mount%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479511%2fget-fsck-to-work-with-pam-mount%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?