When working remotely I set a server to force an fsck at boot time with the sudo touch /forcefsck
command and rebooted.
After it restarted I checked in /var/log/fsck
for the results of the disk check.
Both checkfs and checkroot said: Nothing has been logged yet
So where is it saving the results?
Possibly you are affected by this bug: "Does not log fsck invocations in /var/log/fsck/"
For Ubuntu 14.xx:
I found some fsck logs in
/var/log/upstart/mountall.log
.For Ubuntu 16.04 and 18.04 root partitions
You're likely looking for
/run/initramfs/fsck.log
.An fsck of the root filesystem necessarily happens before the root filesystem has been mounted as writable, so the filesystem check occurs early in the boot process while the system is still running from the initramfs. An fsck log is written to a RAM-backed filesystem (tmpfs) that is available for writing at this time, and it continues to be available after boot at
/run/initramfs/fsck.log
. This is volatile storage, so fsck logs are lost once the system reboots. It would be nice if these logs were copied to non-volatile storage after the root filesystem is mounted as writable, but this does not appear to be the case.Here's an example:
For Ubuntu 16.04
The command
journalctl -b --no-pager | grep systemd-fsck
reports non root partition file system checks.similar to this:
For root partition checks at boot issue the command
more /var/log/boot.log
Provides results similar to this:
For Ubuntu 18.04
The command
journalctl -b --no-pager | grep systemd-fsck
andgrep systemd-fsck /var/log/syslog
both report non root partition file system checks.similar to this:
Checks of root partitions mounted by UUID results don't appear to be logged even if forced.
Testing this with Ubuntu 12.04.5 LTS and I found the log on /var/log/boot.log