ls -la /mnt/containers/snap/
total 263052
drwxr-xr-x 3 root root 70 Nov 13 16:52 .
drwxr-xr-x 4 root root 127 Nov 5 23:05 ..
-rw-r--r-- 1 root root 87089152 Nov 13 16:47 core_3247.snap
drwxr-xr-x 2 root root 6 Sep 26 18:41 partial
-rw-r--r-- 1 root root 182276096 Nov 13 16:52 warzone2100_12.snap
and
mount |grep snap
/dev/mapper/vg_ssd-snap on /mnt/containers type xfs (rw,relatime,attr2,inode64,noquota)
/mnt/containers/snap/core_3247.snap on /snap/core/3247 type squashfs (ro,nodev,relatime)
tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,noexec,relatime,size=3270728k,mode=755)
nsfs on /run/snapd/ns/core.mnt type nsfs (rw)
/mnt/containers/snap/warzone2100_12.snap on /snap/warzone2100/12 type squashfs (ro,nodev,relatime)
So I guess I should really retitle this post to
A more graceful way for snapd to fail when /snap or /var/lib/snapd/snaps is missing.
A symlink will likely not work because of confinemnt. You need a mount or a bind mount at the very least. You can add a systemd mount unit to do the right thing.
A symlink will likely not work because of confinemnt. You need a mount or a bind mount at the very least. You can add a systemd mount unit to do the right thing.
Hmm atm I am sysytemd.mount /mnt/containers I have both flatpak and snap folders there. I spose I could just create a couple more LV’s and mount the separately but talk about added complexity.
You don’t need a partition, a bind mount will suffice
Hmm ok that sounds plausible. It is all to do with timing really. Snapd starts up as soon as systemd.pre-mount finishes and root is mounted, meaning if /var/lib/snapd/snaps is not there it barfs.
I don’t spose snapd is smart enough to just check /var/lib/snapd/snaps for any realtime changes is it? Otherwise I could just leave snaps empty and bindmount over it later in the boot process and restart snapd