[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How can I force a full fsck on a remote system at next reboot?



Hi!

Because of the deprecated use of "# touch /forcefsck" as a method of forcing a file system check on the partition containin /root at boot time I posted here some time ago to see if there might be another way to invoke the function.

I maintain some remote systems that I don't want running a full file system check at inopportune times, but I do make certain that I force a check and examine the results on a regular basis. Anyway, that's why I don't simply modify grub behavior to include "fsck.mode=force" on these systems.

Andrei Popescu suggested at that earlier time that I make use of rc.local or crontab to reset the maximum mount count to 0 late in each boot process. Once this was set up, all I had to do to get a forced fsck on the boot partition was to issue "# tune2fs -c 1 /dev/sdXY" and then reboot the system.

Following this morning's (03/11/2015) upgrade to initramfs-tools, this strategy has ceased to work.

I checked rc.local to be sure that it hadn't been overwritten for some reason, but my "tune2fs -c 1 /dev/sda1" line was still there. Issuing "# tune2fs -c 1 /dev/sda1" still causes the proper setting for the count to be made, but a full file system check does not occur during a reboot.

I read the man pages for systemd-fsck, initramfs-tools, tune2fs, etc. and haven't found a way around the change in behavior.

BTW, the upgrade this morning included the following readme / mail, which is why I immediately tested the systems to see if I could still force a check.

----------8<----------

initramfs-tools (0.119) unstable; urgency=medium

  * The initramfs will now run fsck on the root filesystem before
    mounting it.  If the chosen init program is systemd and there is a
    separate /usr filesystem, it will also fsck and mount /usr.
  * If the /usr filesystem is on a RAID device and the INITRDSTART setting
    in /etc/default/mdadm is not 'all', you will need to change it to
    include that device.
  * If the RTC (real time clock) is set to local time and the local time is
    ahead of UTC, e2fsck will print a warning during boot about the time
    changing backward (bug #767040).  You can disable this by putting the
    following lines in /etc/e2fsck.conf:
        [options]
        broken_system_clock=1

 -- Ben Hutchings <ben@decadent.org.uk>  Sat, 17 Jan 2015 16:56:56 +0000

----------8<----------

Would anyone have a suggestion to make? If there's something obvious, I'm certainly not seeing it.

Many thanks,
JP


Reply to: