How to set an fsck to run after x number of boots
  • binbin
    PMPosts: 41
    fsck is the linux equivalent of check-disk in Windows
    SInce there are many different filesystems each has its own version
    eg fsck.ext3 fsck.ext4

    Error checking is useful but journalled filesystems are robust and so the old method of running an fsck after 30 boots has been disabled in modern desktop side distros.

    Is there any way of finding out if an fsck is set to run in LXLE at either a regular interval or at a certain number of boots?
    To which the answer is:-
    ~:sudo dumpe2fs -h /dev/sda(n)| grep -i "mount count"
    dumpe2fs 1.42.9 (4-Feb-2014)
    Mount count:              37
    Maximum mount count:      -1

    -1 means no autocheck

    If you feel you'd like it to run after so many boots run tune2fs. Running just that at prompt will show you the full range of options.
    ~:sudo tune2fs -c 40 /dev/sda(n)
    tune2fs 1.42.8 (20-Jun-2013)
    Setting maximal mount count to 40
    Sets it to fsck every 40 boots