Announcement

Collapse
No announcement yet.

[SOLVED] How to control fsck on reboot

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] How to control fsck on reboot

    It seems that the Canonical version of shutdown is missing some options. The -F switch is not there. They have even disabled the -f.

    1. Is there a regular version of the shutdown command that I can install?
    2. How do people usually control fsck on reboot?

    #2
    Re: How to control fsck on reboot

    If you want to modify the frequency of checks, use tune2fs. See man tune2fs or Tuning the Filesystem Check at Bootup (dated, but still pertinent)
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: How to control fsck on reboot

      Well, I've read everything I can absorb for now about tune2fs. It looks like to do an fsck you change the number of boots before a check (mount-count) and then reboot. Then after that I suppose it resets itself - nobody talks about that. It seems like a workable solution so I'll go with it for now. Tune2fs is certainly worth learning about. Thanks Snowhog.

      If I'm not back on-line in 10 minutes, send someone out to look for me.

      Comment


        #4
        Re: How to control fsck on reboot

        OK, I'm back, and here's the scoop. I'm assuming /dev/sda6, but change as needed. To see the file system layout of your system just type "df". Other than figuring out the name of the drive, the rest is simple:

        1. Check the stats of the drive you want to check:
        Code:
        sudo tune2fs -l /dev/sda6
        2. Ubuntu forces a check every 30 boots so change the "Mount count:" to 31:
        Code:
        sudo tune2fs -C 31 /dev/sda6
        3. reboot:
        Code:
        sudo shutdown -r now
        When I rebooted, the system did a file check, which took quite a while. When the system came back up, I checked the stats again as per step 1. The "mount count' was changed to 1.

        So, that's how to do it.

        PS: I checked on the web for an older shutdown command which might include the -F switch, but gave up. I think I'd just be bucking the system on that one. Using tune2fs is pretty easy, especially in this case where "man tune2fs" is not too hard too understand.

        Comment


          #5
          Re: [SOLVED] How to control fsck on reboot

          Just to keep you busy: I seem to recall that there is a way to make automagical fsck checks run at shutdown in *buntu. Unfortunately, I can't recall what it is.

          Comment


            #6
            Re: [SOLVED] How to control fsck on reboot

            For those interested: AutoFsck/Doc
            Windows no longer obstructs my view.
            Using Kubuntu Linux since March 23, 2007.
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment


              #7
              Re: [SOLVED] How to control fsck on reboot

              Good call Snowdog. Odd that didn't come up in my net search. It is not in the repositories either, so you have to download the .deb. The instructions are on the link that Snowdog gave, but the way I do "dot debs" is:
              Code:
              sudo dpkg -i autofsck_3.2-1_all.deb
              Autofsck_3...etc is the name of the .deb, so change to suit the latest download. After installation, it shows up in the KDE menu under System > Periodic Disk Checking. Now that I look at it, it seems to do a subset of tune2fs. A nice easy click here solution.

              @Snowdog: Anything else you want me to review?

              Comment


                #8
                Re: [SOLVED] How to control fsck on reboot

                Originally posted by Ole Juul
                @Snowdog: Anything else you want me to review?
                hehehe. Funny guy.
                Windows no longer obstructs my view.
                Using Kubuntu Linux since March 23, 2007.
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  Re: [SOLVED] How to control fsck on reboot

                  If you just want to force a filesystem check on next boot, you can use the command:
                  Code:
                  sudo touch /forcefsck

                  Comment


                    #10
                    Re: [SOLVED] How to control fsck on reboot

                    Would anyone who knows tune2fs care to write up a HowTo for the simple minded among us?
                    Welcome newbies!
                    Verify the ISO
                    Kubuntu's documentation

                    Comment


                      #11
                      Re: [SOLVED] How to control fsck on reboot

                      Originally posted by kubicle
                      If you just want to force a filesystem check on next boot, you can use the command:
                      Code:
                      sudo touch /forcefsck
                      I've seen that mentioned all over the place, but just took it as noise because nobody takes the time to explain why there is no forcefsck file in my root directory to which I can apply touch.

                      Comment


                        #12
                        Re: [SOLVED] How to control fsck on reboot

                        Here ya go bud!

                        Hard Drive Check Forced Note how 'old' this is; been around awhile.
                        Windows no longer obstructs my view.
                        Using Kubuntu Linux since March 23, 2007.
                        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                        Comment


                          #13
                          Re: [SOLVED] How to control fsck on reboot

                          Originally posted by Ole Juul
                          Originally posted by kubicle
                          If you just want to force a filesystem check on next boot, you can use the command:
                          Code:
                          sudo touch /forcefsck
                          I've seen that mentioned all over the place, but just took it as noise because nobody takes the time to explain why there is no forcefsck file in my root directory to which I can apply touch.
                          Code:
                          man touch
                          contains the following
                          A FILE argument that does not exist is created empty

                          Comment


                            #14
                            Re: [SOLVED] How to control fsck on reboot

                            Originally posted by Telengard
                            Would anyone who knows tune2fs care to write up a HowTo for the simple minded among us?
                            The man page is pretty clear about the simple stuff. Using reserved blocks is a bit more difficult to understand for me. There is a little writeup here: http://www.unixtutorial.org/commands/tune2fs/

                            Comment


                              #15
                              Re: [SOLVED] How to control fsck on reboot

                              A FILE argument that does not exist is created empty
                              By golly, that works too! Thanks skunk. It would not have occurred to me to use touch in that way. I'll go back and try the idea of making an empty file called forcefsck and see how that works.

                              Comment

                              Working...
                              X