Automounting NAS with fstab
Most (but not every) time I booted the PC I felt myself age as I waited to reach the login prompt, with only a cryptic message:
/dev/sda2 : clean, 849958/13516800 files, 8182641/54037900 blocks
For ages I’d ignored it, chalked it up as one of life’s great mysteries, particularly given its intermittence, before encountering an ancient laptop booting in seconds. Embarrassed that my game development workstation crawled into life, I started poking around for a cause of my message, and learned about the command systemd-analyze blame to inspect startup times of different units. Running it, my custom units were right at the top.
By putting them in systemd’s dependency graph I was stalling the whole system waiting for contact with the NAS. Since the NAS needs to spin up its disks before any filesystems can be mounted, it no longer mattered that I had been running operating systems on SSDs for a decade or more, I had locked myself out of logging in until the NAS was ready. The intermittence of course being that sometimes the NAS would already be running when I tried to boot the PC, in which case there was boot hang at all.
As is often the case, the Arch forum thread presented the solution. I’d been overcomplicating the problem with systemd units and should instead have been managing file systems with the file system table, or /etc/fstab. Who’d have thought? So, I deleted my systemd units and added some lines to /etc/fstab:
sleeper-service:/volume1/Music /sleeper-service/Music nfs timeo=14,retrans=2,soft,bg 0 0
...
Now my system boots whether the NAS is powered on or not, and instead the NAS boots when I first try to access the drive. Much better!