[clug] Debian Jessie file system checking on boot up

Scott Ferguson scott.ferguson.clug at gmail.com
Tue Apr 5 11:43:44 UTC 2016



On 05/04/16 21:36, George at Clug wrote:
>     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


**That seems to suggest fsck has been run (??)**

To force a full fsck just set the system date a few weeks into the
future and reboot (if you have ntpdate enabled, disable your internet).


> 
> 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.)


Anything in journalctl?

> 
> 
> # nano /etc/default/grub
> GRUB_CMDLINE_LINUX_DEFAULT="quiet fsck.mode=force"
> 
> #  update-grub
> 
<snipped>
> 
> 
> https://lists.debian.org/debian-user/2015/04/msg01423.html

(I read the Debian User lists) - Jape has a long and confusing history
with fsck on boot (and systemd).



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

That 'should' work (sorry, I don't have time to check tonight, but I can
check tomorrow if I read that you are still having trouble).

A couple of things to check:-
;that you are running a recent version of initramfs-tools (there was a
bug affecting earlier version which affected fsck on boot)
;you have a stock kernel


(Posting this from a different machine than the previous post) - I know
this box can do fsck on boot, the other has a custom kernel and fsck on
boot is disabled. This box is Debian Jessie with backports using default
systemd config

dpkg -l initramfs-tools|tail -n1;uname -r
it  initramfs-tools 0.120+deb8u1 all          generic modular initramfs
generator
4.3.0-0.bpo.1-686-pae


fsck runs on boot on this box. i.e. on boot initramfs calls fsck, fsck
checks for last full check date or other triggers. If a trigger is
found, fsck is run (as it was earlier today on this box as the clock
battery is dying so fsck runs before ntpdate can run as it doesn't
automagically get internet)


Just so that there's no confusion - fsck *must* run on every boot as you
run a journalled file system. It 'should' do a "full" run *only* after a
certain number of boots or if journal errors are detected.



/etc/default/grub

GRUB_DEFAULT=0
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""


/etc/fstab
UUID=5a16d8e1-811d-46d1-9bbe-9af9c49e801c /               ext4
noatime,user_xattr,errors=remount-ro 0       1

nothing in /etc/rc.local (if you've upgraded from earlier Debian you
should check there for old fsck commands)


<snipped>




More information about the linux mailing list