Check system disk for errors

Hi! I used the option in the dietpi drive manager to check for errors on my system disk (SSD, ext4) and then checked with the journalctl -t systemd-fsck like recommended, however, this is what I get:

-- Journal begins at Sat 2022-03-12 12:58:34 GMT, ends at Sat 2022-03-12 13:05:38 GMT. --
Mar 12 12:58:34 DietPi systemd-fsck[131]: Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system.
Mar 12 12:58:34 DietPi systemd-fsck[141]: e2fsck 1.46.2 (28-Feb-2021)
Mar 12 12:58:34 DietPi systemd-fsck[141]: Pass 1: Checking inodes, blocks, and sizes
Mar 12 12:58:35 DietPi systemd-fsck[141]: Pass 2: Checking directory structure
Mar 12 12:58:37 DietPi systemd-fsck[141]: Pass 3: Checking directory connectivity
Mar 12 12:58:37 DietPi systemd-fsck[141]: Pass 4: Checking reference counts
Mar 12 12:58:38 DietPi systemd-fsck[141]: Pass 5: Checking group summary information
Mar 12 12:58:39 DietPi systemd-fsck[141]: /dev/sda2: 268328/14590080 files (0.2% non-contiguous), 6046097/58573974 blocks
Mar 12 12:58:40 DietPi systemd-fsck[301]: Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system.
Mar 12 12:58:40 DietPi systemd-fsck[303]: fsck.fat 4.2 (2021-01-31)
Mar 12 12:58:40 DietPi systemd-fsck[303]: /dev/sda1: 445 files, 68613/258078 clusters

I’m not sure what to interpret from here, actually. :smiley:

You mean this line?
Mar 12 12:58:40 DietPi systemd-fsck[301]: Please pass ‘fsck.mode=force’ on the kernel command line rather than creating /forcefsck on the root file system.
It’s more like an info as an error report.

It means you should add this command there instead of running it by CLI.
You could do this like mentioned here:
see Raspberry Pi 3 and Raspbian Jessie - How to run fsck at boot? - Raspberry Pi Stack Exchange

Add the following to /boot/cmdline.txt:

fsck.mode=force

Make sure that file remains all one line. Parameters should be separated with spaces.

But I don’t see any errors, so you don’t have to do anything.
The 0.2% non-contiguous means 0.2% is fragmentated, I guess.

Thank you so much for the insight, Jappe!

More precisely, systemd nowadays expects fsck on reboot to be forced with fsck.mode=force kernel command line argument instead of creating the /forcefsck file. But it is nasty (no genetic method) to add kernel command line arguments in general and it is president, so would need to be removed again after reboot. This would require us to implement a complex method to add the kernel command line argument, specific for the individual SBC model and kernel implementation, still not assured to work with custom kernels or images, then create a flag file, check it on boot to remove the argument again. Creating the /forcefsck file on the other hand is trivial, still works on all hardware models and kernel implementation the same way and is automatically removed by systemd on boot, to be a one time action. It is a shame that this method got deprecated without any similarly simple and genetic replacement.