Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Every boot runs fsck?

  1. #1
    Join Date
    Jan 2011
    Beans
    4

    Every boot runs fsck?

    Greetings from an "ubuntu newbie" ...

    Questions:
    Is fsck being run every time I boot ubuntu? If so, isn't this overkill, and what should I do about it?

    Mine is a dual-boot system (win7, ubuntu 10.10 64-bit), and during every boot of ubuntu the following two-line message shows briefly on the screen (and in /var/log/boot.log):

    fsck from util-linux-ng 2.17.2
    /dev/sda5: clean, 159106/5513216 files, 1743352/22023936 blocks


    (These two lines are usually followed by others that seem okay and unrelated to my questions; e.g., stuff about "Starting AppArmor profiles" and "Setting sensors limits".)

    However, after booting, the command
    Code:
    sudo tune2fs -l /dev/sda5
    now displays the following info:

    ...
    Mount count: <less than 31, increasing by 1 after each boot>
    Maximum mount count: 31
    Last checked: Wed Feb 2 10:38:56 2011 <---- this remains the same before/after booting
    Check interval: 15552000 (6 months)
    Next check after: Mon Aug 1 11:38:56 2011
    ...

    (The "Last checked" time is yesterday when the Mount count reached the Maximum count, presumably causing fsck to be run, and the count was reset to 1.)

    So, is fsck *not* being run now at every boot, in spite of the two-line boot-time message that seems to say otherwise?

    btw, DO NOT attempt to run fsck for a mounted partition (e.g. "fsck /dev/sda5" in my case), as doing so results in the following ...
    WARNING!!! The filesystem is mounted. If you continue you ***WILL*** cause ***SEVERE*** filesystem damage.
    Last edited by myanon0001; February 3rd, 2011 at 05:53 PM. Reason: add warning not to run fsck for a mounted partition

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Every boot runs fsck?

    It's just an information message letting you know that the volume is "clean"
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Apr 2007
    Beans
    3,142
    Distro
    Ubuntu

    Re: Every boot runs fsck?

    fsck *is* run on every boot. However, it only concerns a very quick check to see whether the journal is clean. Only once in a while, a full check is performed. This used to take quite some time, but nowadays, with ext4, these full checks are also quite fast.

    You really want your partitions checked on every boot

    As a tip, consider checking removable USB disks manually every now and then. These drives otherwise *NEVER* get checked.

    Whether a partition is checked or not during startup is controlled by a setting in /etc/fstab.

  4. #4
    Join Date
    Mar 2010
    Location
    /home
    Beans
    9,576
    Distro
    Xubuntu

    Re: Every boot runs fsck?

    Unless you change the settings, a full fsck is run every 30 boots (or perhaps every 30 days whichever comes first I think).

    As pointed out, you should leave things as they are in order to keep things stable.

  5. #5
    Join Date
    Dec 2010
    Location
    Something witty.
    Beans
    203
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Every boot runs fsck?

    I'm curious as to the reasoning of why fsck should be left to run on every boot and "keep everything stable". Unless someone is consistently unplugging their computer during the middle of intensive writes/reads, I see no reason why a hard drive would have that many file system errors on it, especially not one with an advanced journaling file system.

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Every boot runs fsck?

    Quote Originally Posted by blind2314 View Post
    I'm curious as to the reasoning of why fsck should be left to run on every boot and "keep everything stable". Unless someone is consistently unplugging their computer during the middle of intensive writes/reads, I see no reason why a hard drive would have that many file system errors on it, especially not one with an advanced journaling file system.
    It runs every boot by default, but it doesn't actually run a file system check unless you are at the mount/time limit or unless you tell it to run a check with:

    Code:
    sudo touch /forcefsck
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  7. #7
    Join Date
    Jan 2011
    Beans
    4

    Re: Every boot runs fsck?

    Thanks for the explanations, everyone. To further explore the matter, I ran fsck with and without the "full" option from a Live USB-stick with /dev/sda5 not mounted.

    Indeed, the command
    Code:
    sudo fsck /dev/sda5
    took only an instant to execute, and gave exactly the same "clean" report as mentioned above -- consistent with "checking" only by referring to info journaled since the last "full" check.

    On the other hand, the "full" version of the command
    Code:
    sudo fsck -f /dev/sda5
    resulted in ...

    fsck from util-linux-ng 2.17.2
    e2fsck 1.41.12 (17-May-2010)

    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information

    /dev/sda5: ***** FILE SYSTEM WAS MODIFIED *****
    /dev/sda5: 159136/5513216 files (0.3% non-contiguous), 1743062/22023936 blocks
    ubuntu@ubuntu:~$

    ... and now the above tune2fs command shows a correspondingly updated "Last checked" time.

    (I've marked this thread as SOLVED. Thanks again.)
    Last edited by myanon0001; February 3rd, 2011 at 07:15 PM.

  8. #8
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Every boot runs fsck?

    The "file system was modified" message usually means that something was changed, either an error was fixed, or something.

    Does it do the same thing it you use fsck -f again ?
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  9. #9
    Join Date
    Jan 2011
    Beans
    4

    Re: Every boot runs fsck?

    Quote Originally Posted by CharlesA View Post
    The "file system was modified" message usually means that something was changed, either an error was fixed, or something.

    Does it do the same thing it you use fsck -f again ?
    No, it now goes through all those passes with no report of any modifications.

    I figure the modifications the first time were probably benign, maybe something like ms-windows "defrag"?

  10. #10
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Every boot runs fsck?

    That's good then. Normally fsck will only make modifications after prompting you.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •