[clug] Debian Jessie file system checking on boot up

George at Clug Clug at goproject.info
Tue Apr 5 11:36:23 UTC 2016


I get the following results from the below commands, any idea why fsck
is not running?, or how to fix it?

# systemctl status systemd-fsck-root.service
● systemd-fsck-root.service - File System Check on Root Device
   Loaded: loaded (/lib/systemd/system/systemd-fsck-root.service;
   Active: inactive (dead)
           start condition failed at Tue 2016-04-05 14:32:36
AEST; 6h ago
           ConditionPathExists=!/run/initramfs/fsck-root was
not met
     Docs: man:systemd-fsck-root.service(8)

# cat   /run/initramfs/fsck.log
Log of fsck -C -a -T -t ext4 /dev/sda1 
Tue Apr  5 04:32:35 2016

/dev/sda1: clean, 106339/6291456 files, 12533180/25140992 blocks

Tue Apr  5 04:32:35 2016

# cat /etc/fstab 
# / was on /dev/sda1 during installation
/               ext4    errors=remount-ro
0       1

# ls -al /run/initramfs/fsck-root
-rw-r--r-- 1 root root 0 Apr  5 14:32 /run/initramfs/fsck-root

# cat /var/log/fsck/checkroot 
(Nothing has been logged yet.)

# cat /var/log/fsck/checkfs
(Nothing has been logged yet.)

# nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet fsck.mode=force"

#  update-grub

SYSTEMD-FSCK at .SERVICE(8)                               
systemd-fsck at .service                               

       systemd-fsck at .service, systemd-fsck-root.service,
systemd-fsck - File system checker logic

       systemd-fsck at .service



       systemd-fsck at .service and systemd-fsck-root.service are
services responsible for file system checks. They are instantiated for
       each device that is configured for file system
checking.  systemd-fsck-root.service is responsible for file system
checks on
       the root file system, but in only if the root filesystem
wasn't checked in the initramfs.  systemd-fsck at .service is used for
       all other file systems and for the root file system in
the initramfs.

       Those services are started at boot if passno in
/etc/fstab for the file system is set to a value greater than zero.
The file
       system check for root is performed before the other file
systems. Other file systems may be checked in parallel, except when
       they are one the same rotating disk.

       systemd-fsck does not know any details about specific
filesystems, and simply executes file system checkers specific to each
       filesystem type (/sbin/fsck.*). This helper will decide
if the filesystem should actually be checked based on the time since
       last check, number of mounts, unclean unmount, etc.

       systemd-fsck will forward file system checking progress
to the console. If a file system check fails for a service without
       nofail, emergency mode is activated, by isolating to

       systemd-fsck understands one kernel command line

           One of "auto", "force", "skip". Controls the mode
of operation. The default is "auto", and ensures that file system
           are done when the file system checker deems them
necessary.  "force" unconditionally results in full file system
           "skip" skips any file system checks.

           One of "preen", "yes", "no". Controls the mode of
operation. The default is " preen", and will automatically repair
           problems that can be safely fixed.  "yes " will
answer yes to all questions by fsck and "no" will answer no to all

       systemd(1), fsck(8), systemd-quotacheck.service(8),
fsck.btrfs(8), fsck.cramfs(8), fsck.ext4(8), fsck.fat(8),
       fsck.minix(8), fsck.ntfs(8), fsck.xfs(8)


In further conversations on this list I was told I could create an
additional grub menu entry which included fsck.mode=force and then use
the grub-reboot command to get the remote systems to select that entry
at the time of the next boot.

Next you need to run update-grub to set up the default change.  

At Tuesday, 05-04-2016 on 20:40 Scott Ferguson wrote:

On 05/04/16 20:11, George at Clug wrote:
>     Does anyone know how to get a Debian Jessie server to check
> repair its root file system on boot up ?
> I have tried "shutdown -rF now" but this command fails with an error
> message.
> And the below idea does not cause fsck to run either;
> $ sudo touch /forcefsck 

That hasn't worked for sometime (since Jessie became stable).

do you get a failed in the output of:-
systemctl status systemd-fsck-root.service

● systemd-fsck-root.service - File System Check on Root Device
   Loaded: loaded (/lib/systemd/system/systemd-fsck-root.service;
   Active: inactive (dead)
           start condition failed at Tue 2016-04-05 11:10:02
AEST; 9h ago
           ConditionPathExists=!/run/initramfs/fsck-root was
not met

If so - take a look at the man page referenced in the line below it.
you get stuck, post.

NOTE: that in my case the fail is deliberate (I don't want fsck on
- I only run it when I get a warning).

Kind regards

linux mailing list
linux at lists.samba.org

More information about the linux mailing list