How to force a file system check on the next boot of the root file system on Gentoo running systemd?

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











up vote
0
down vote

favorite












I want to force a fsck run on my root filessystem on my Gentoo system running systemd.



I've tried



  • adding an empty forcefsck file at the root of the filesystem which I want to check, e.g. touch /forcefsck

  • adding fsck.mode=force as kernel boot parameter

Nothing worked so far. What's the right approach?










share|improve this question





















  • I would recommend to explore /etc/inittab which can give you control for the next boot.<Thanks>
    – Dzango
    Jul 15 '15 at 9:29










  • So changing the boot configuration twice has been exchanged for changing the fstab twice.... Intercepting the boot in the bootloader, then enter editing the command line and adding the parameter(s) for the boot en boot doesn't change any config (permanently). Should be easy to do with grub involved.
    – user306274
    Aug 19 at 11:58














up vote
0
down vote

favorite












I want to force a fsck run on my root filessystem on my Gentoo system running systemd.



I've tried



  • adding an empty forcefsck file at the root of the filesystem which I want to check, e.g. touch /forcefsck

  • adding fsck.mode=force as kernel boot parameter

Nothing worked so far. What's the right approach?










share|improve this question





















  • I would recommend to explore /etc/inittab which can give you control for the next boot.<Thanks>
    – Dzango
    Jul 15 '15 at 9:29










  • So changing the boot configuration twice has been exchanged for changing the fstab twice.... Intercepting the boot in the bootloader, then enter editing the command line and adding the parameter(s) for the boot en boot doesn't change any config (permanently). Should be easy to do with grub involved.
    – user306274
    Aug 19 at 11:58












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I want to force a fsck run on my root filessystem on my Gentoo system running systemd.



I've tried



  • adding an empty forcefsck file at the root of the filesystem which I want to check, e.g. touch /forcefsck

  • adding fsck.mode=force as kernel boot parameter

Nothing worked so far. What's the right approach?










share|improve this question













I want to force a fsck run on my root filessystem on my Gentoo system running systemd.



I've tried



  • adding an empty forcefsck file at the root of the filesystem which I want to check, e.g. touch /forcefsck

  • adding fsck.mode=force as kernel boot parameter

Nothing worked so far. What's the right approach?







systemd gentoo fsck






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 15 '15 at 8:25









Flow

438516




438516











  • I would recommend to explore /etc/inittab which can give you control for the next boot.<Thanks>
    – Dzango
    Jul 15 '15 at 9:29










  • So changing the boot configuration twice has been exchanged for changing the fstab twice.... Intercepting the boot in the bootloader, then enter editing the command line and adding the parameter(s) for the boot en boot doesn't change any config (permanently). Should be easy to do with grub involved.
    – user306274
    Aug 19 at 11:58
















  • I would recommend to explore /etc/inittab which can give you control for the next boot.<Thanks>
    – Dzango
    Jul 15 '15 at 9:29










  • So changing the boot configuration twice has been exchanged for changing the fstab twice.... Intercepting the boot in the bootloader, then enter editing the command line and adding the parameter(s) for the boot en boot doesn't change any config (permanently). Should be easy to do with grub involved.
    – user306274
    Aug 19 at 11:58















I would recommend to explore /etc/inittab which can give you control for the next boot.<Thanks>
– Dzango
Jul 15 '15 at 9:29




I would recommend to explore /etc/inittab which can give you control for the next boot.<Thanks>
– Dzango
Jul 15 '15 at 9:29












So changing the boot configuration twice has been exchanged for changing the fstab twice.... Intercepting the boot in the bootloader, then enter editing the command line and adding the parameter(s) for the boot en boot doesn't change any config (permanently). Should be easy to do with grub involved.
– user306274
Aug 19 at 11:58




So changing the boot configuration twice has been exchanged for changing the fstab twice.... Intercepting the boot in the bootloader, then enter editing the command line and adding the parameter(s) for the boot en boot doesn't change any config (permanently). Should be easy to do with grub involved.
– user306274
Aug 19 at 11:58










2 Answers
2






active

oldest

votes

















up vote
2
down vote













The latter (fsck.mode=force) is the right approach. However, to fsck a root, you must either:



  • have a systemd-controlled initramfs (so that it could parse fsck.mode=force) with the corresponding fsck binary built in;

  • have an initramfs which mounts rootfs read-only (so that systemd, started from rootfs, still can check it — checking a read-write mounted filesystem is impossible);

  • have no initramfs and tell kernel to mount rootfs read-only (by ro kernel cmdline parameter).





share|improve this answer



























    up vote
    0
    down vote













    I had the same issue, what worked for me was ignore what is written on blogs and go read the man page. Having to change your boot configuration twice for simply forcing a check of your root partition did not sound right.



    You specify passno=1 in your /etc/fstab for the filesystems you would like to check and reboot. Simply remove the entry after reboot.



    The man page






    share|improve this answer




















      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: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      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%2f216105%2fhow-to-force-a-file-system-check-on-the-next-boot-of-the-root-file-system-on-gen%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      2
      down vote













      The latter (fsck.mode=force) is the right approach. However, to fsck a root, you must either:



      • have a systemd-controlled initramfs (so that it could parse fsck.mode=force) with the corresponding fsck binary built in;

      • have an initramfs which mounts rootfs read-only (so that systemd, started from rootfs, still can check it — checking a read-write mounted filesystem is impossible);

      • have no initramfs and tell kernel to mount rootfs read-only (by ro kernel cmdline parameter).





      share|improve this answer
























        up vote
        2
        down vote













        The latter (fsck.mode=force) is the right approach. However, to fsck a root, you must either:



        • have a systemd-controlled initramfs (so that it could parse fsck.mode=force) with the corresponding fsck binary built in;

        • have an initramfs which mounts rootfs read-only (so that systemd, started from rootfs, still can check it — checking a read-write mounted filesystem is impossible);

        • have no initramfs and tell kernel to mount rootfs read-only (by ro kernel cmdline parameter).





        share|improve this answer






















          up vote
          2
          down vote










          up vote
          2
          down vote









          The latter (fsck.mode=force) is the right approach. However, to fsck a root, you must either:



          • have a systemd-controlled initramfs (so that it could parse fsck.mode=force) with the corresponding fsck binary built in;

          • have an initramfs which mounts rootfs read-only (so that systemd, started from rootfs, still can check it — checking a read-write mounted filesystem is impossible);

          • have no initramfs and tell kernel to mount rootfs read-only (by ro kernel cmdline parameter).





          share|improve this answer












          The latter (fsck.mode=force) is the right approach. However, to fsck a root, you must either:



          • have a systemd-controlled initramfs (so that it could parse fsck.mode=force) with the corresponding fsck binary built in;

          • have an initramfs which mounts rootfs read-only (so that systemd, started from rootfs, still can check it — checking a read-write mounted filesystem is impossible);

          • have no initramfs and tell kernel to mount rootfs read-only (by ro kernel cmdline parameter).






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 15 '15 at 10:26









          intelfx

          2,8561122




          2,8561122






















              up vote
              0
              down vote













              I had the same issue, what worked for me was ignore what is written on blogs and go read the man page. Having to change your boot configuration twice for simply forcing a check of your root partition did not sound right.



              You specify passno=1 in your /etc/fstab for the filesystems you would like to check and reboot. Simply remove the entry after reboot.



              The man page






              share|improve this answer
























                up vote
                0
                down vote













                I had the same issue, what worked for me was ignore what is written on blogs and go read the man page. Having to change your boot configuration twice for simply forcing a check of your root partition did not sound right.



                You specify passno=1 in your /etc/fstab for the filesystems you would like to check and reboot. Simply remove the entry after reboot.



                The man page






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  I had the same issue, what worked for me was ignore what is written on blogs and go read the man page. Having to change your boot configuration twice for simply forcing a check of your root partition did not sound right.



                  You specify passno=1 in your /etc/fstab for the filesystems you would like to check and reboot. Simply remove the entry after reboot.



                  The man page






                  share|improve this answer












                  I had the same issue, what worked for me was ignore what is written on blogs and go read the man page. Having to change your boot configuration twice for simply forcing a check of your root partition did not sound right.



                  You specify passno=1 in your /etc/fstab for the filesystems you would like to check and reboot. Simply remove the entry after reboot.



                  The man page







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 25 '17 at 15:44









                  thecarpy

                  2,210824




                  2,210824



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f216105%2fhow-to-force-a-file-system-check-on-the-next-boot-of-the-root-file-system-on-gen%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?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay