[clug] Debian Jessie file system checking on boot up

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


    Scott,

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;
static)
   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
UUID=0b515199-f2fc-46fb-83e6-d7909e1b52d9
/               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(8)

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

SYNOPSIS
       systemd-fsck at .service

       systemd-fsck-root.service

       /lib/systemd/systemd-fsck

DESCRIPTION
       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
emergency.target.

KERNEL COMMAND LINE
       systemd-fsck understands one kernel command line
parameter:

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

       fsck.repair=
           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
           questions.

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


https://lists.debian.org/debian-user/2015/04/msg01423.html

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
and
> 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


e.g.:-
● systemd-fsck-root.service - File System Check on Root Device
   Loaded: loaded (/lib/systemd/system/systemd-fsck-root.service;
static)
   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.
If
you get stuck, post.


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




Kind regards

-- 
linux mailing list
linux at lists.samba.org
https://lists.samba.org/mailman/listinfo/linux




More information about the linux mailing list