[ale] systemd - howto wait for _all_ fsck's to finish before starting system

Steve Tynor stevejunk at iintiip.com
Fri Dec 1 08:00:15 EST 2023


Ubuntu Server 22.04 LTS.  I have a fairly large file system (/home) that 
I wish to fsck at boot.  /etc/fstab has:

     /dev/disk/by-uuid/b4d368cd-e22e-4c85-b261-c0d785de344e /boot ext4 
defaults 0 1
     /dev/md/ricotta:1     /home     ext4 defaults,nofail,discard 0 2

On boot, the /boot filesystem get's fsck'd and then systemd seems to 
immediately start the rest of the system in parallel with fsck'ing 
/home.    This is a problem since I have some cron jobs, docker 
containers and other services that rely on directories in /home. Those 
services don't startup nicely if the fsck hasn't finished.

I'm guessing I could add [Wants] annotation to various .service files 
(if I could figure out what base service to target), but 1) it seems 
like this should work "out of the box", 2) editing half a dozen system 
provided .service files seems fiddly and error prone.

I've not found any ready-made advice via google.   Which surprises me - 
surely wanting to check _all_ file systems before starting the rest of 
the system is not _that_ uncommon?

(please don't let this devolve into a systemd bashing thread - I don't 
like systemd, but I've chosen to use Ubuntu and want to live within its 
expectations...)

Thanks for any advice!

Steve





More information about the Ale mailing list