Ubuntu 22.04 on Raspberry Pi: /var/cache/fontconfig Gets Created Before /var Is Mounted

I’m running Ubuntu 22.04 (Jammy Jellyfish, ARM64) on a Raspberry Pi. After imaging the Pi’s SSD, I re-partitioned the drive and mirrored the contents of /var onto the new partition (verified), renamed the original /var to /var.old before making a fresh, empty /var directory for use as a mount point. The appropriate change was made to fstab and everything was working exactly as expected after several re-boots into the SSD’s Ubuntu. Afterwards, I booted the Pi using a microSD card and mounted /dev/sda2 (Ubuntu’s root on the SSD) to find a populated fontconfig directory under the SSD’s otherwise empty /var. This leads me to believe that something (a script or systemd, maybe) is writing to the mount point directory shortly after the root is mounted, but before the intended partition for var is. Please note that the partition which eventually gets mounted at /var also has it’s own fontconfig directory, which differs in its contents from the otherwise empty mount point folder’s.
I’m somewhat new to Linux in general, and have no idea where to begin looking. Search engines haven’t returned anything useful. Having a dedicated partition for /var is, to my understanding, a very standard configuration in Linux. My question: Is there a way to make sure nothing gets written to /var until the bespoke partition is mounted? Thanks in advance.

Asked By: SpaceManAce

||
sudo systemctl disable fontconfig-regenerate-cache.service

is a workaround. But you’ll have to re-generate your font cache manually when necessary.

Answered By: SpaceManAce
Categories: Answers Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.