Good catch! It started working after I edited /etc/fstab in the template.
But this didn’t fully solve the mystery, yet. According to the man page I linked above:
Mounts listed in /etc/fstab will be converted into native units dynamically at boot and when the configuration of the system manager is reloaded.
So that suggests the automount unit should still be created automatically, if you just run systemctl daemon-reload (and without rebooting). Because at that stage, the bind-dir version of /etc/fstab is already mounted in the AppVM. However, it still didn’t work and I couldn’t see the new automount unit using systemctl status '*automount'.
It turns out that the unit was being created correctly, but it was being left in an inactive state (which I guess is a systemd quirk). I was able to see it eventually using systemctl status -all '*automount'.
So in the end, the solution was to additionally run systemctl start <unit>.automount. Afterwards everything works as expected.
This is the final setup I’m using (all configuration is in an AppVM):
/etc/fstab:
UUID=<partition-uuid> /mount/point auto defaults,nofail,x-systemd.automount,x-systemd.device-timeout=1 0 0
/rw/config/qubes-bind-dirs.d/50_user.conf:
binds+=( /etc/fstab )
/rw/config/rc.local:
systemctl daemon-reload
systemctl start <unit>.automount
To find the string for <unit>, run systemctl status -all '*automount' and look for the one that matches your mount point; it might contain some escaped characters.
Thanks again @KitsuneNoBaka. The breakthrough here came after realising that bound-dirs are not mounted immediately at boot time.
EDIT: Just a heads up that the partition got corrupted soon after I started using this. I put the laptop to sleep without unmounting the partition first; when I resumed the laptop, all the files on the partition (ext4) were gone (it was bad enough that utilities like fsck couldn’t fix it using the superblock backups; photorec could recover the files, but testdisk couldn’t recover the directory structure). I’m not sure if it’s related to the systemd automounting configuration, or just a shitty coincidence. It’s probably related to: Implement facilities for handling unexpected physical removal of block devices · Issue #1082 · QubesOS/qubes-issues · GitHub . Currently discussing alternatives at Having to re-attach USB drive partitions after waking laptop from sleep .