Day: August 17, 2022

Force `fsck` on reboot for Ubuntu 20.04

Force fsck on reboot for Ubuntu 20.04

The Maximum mount setting for ext4 file system can be used to enforce fsck to be executed on root file system.

Check current value

sudo tune2fs -l /dev/nvme0n1p2 | grep 'Maximum mount'

Note: Chances are this is set to -1 nowadays, disabling check based on the number of times the volume has been mounted.

Adjust the setting to 1 with the command:

sudo tune2fs -c 1 /dev/nvme0n1p2

References

How to force fsck on reboot for Ubuntu 20.04

Reduce size of folder `/var/log/journal` and `/var/cache/abrt-di` in Ubuntu

Reduce size of folder /var/log/journal and /var/cache/abrt-di in Ubuntu

/var/log/journal

Check disk usage

journalctl --disk-usage

Change configuration

Edit /etc/systemd/journald.conf

SystemMaxUse=50M

Restart service

systemctl restart systemd-journald.service

/var/cache/abrt-di

Check Max size of the log files

$ grep -i size /etc/abrt/abrt.conf 
# Max size for crash storage [MiB] or 0 for unlimited
MaxCrashReportsSize = 1000

Check Max size of /var/cache/abrt-di

$ grep -i DebugInfoCacheMB /etc/abrt/plugins/CCpp.conf
DebugInfoCacheMB = 2000

References

Can I remove files in /var/log/journal and /var/cache/abrt-di/usr?