@ElvishJerricco
This is the not-so-working configuration.
And a bind mount depends on one zfs filesystems was directly mounted. Systemd mount unit says “mounted”, “successfully” about those not-mounted ones.
Sorry for the confusing. The first sentence was a mis-statement. I meant all not-mounted systemd mount units status were mounted and successfully turned into dead. But the result was filesystems actually not mounted. So I thought something unmounted those.
And this is the zfs list
:
NAME USED AVAIL REFER MOUNTPOINT
raid 2.16T 1.92T 456K /mnt/data
raid/backup 1.03T 1.92T 1.03T legacy
raid/conf 13.3M 1.92T 13.3M legacy
raid/db 47.2M 1.92T 47.2M legacy
raid/docker 388G 1.92T 2.54G legacy
# 1358 lines of filesystems within raid/docker like this one
raid/docker/0042c0e4a9fe44fd6bb2857c78fbc7fc9859551ee45e4f090184618fcb296a47 87.1M 1.92T 833M legacy
raid/downloads 201G 1.92T 201G legacy
raid/home 190G 1.92T 190G legacy
raid/upload 374G 1.92T 374G legacy
I updated all mountpoints except those 1358 lines (those are created by Docker, per another post, it only uses legacy). And removed those filesystems entries. After reboot, those were mounted. And I cannot zfs mount -a
because after a while, something would unmount the ones outside those four. And I checked the attributes between a mounted one (db) and not-mounted one (backup), nothing except size/date/guid is different.
$ zfs mount
raid /mnt/data
raid/db /mnt/data/db
raid/conf /mnt/data/conf
raid/docker /mnt/data/docker
“zfs-mount” does not give log. Following is the log around zfs-mount.
Mar 08 23:10:04 nixos zfs-import-raid-start[1126]: importing ZFS pool "raid"...Successfully imported raid
Mar 08 23:10:04 nixos systemd[1]: Finished Import ZFS pool "raid".
░░ Subject: A start job for unit zfs-import-raid.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit zfs-import-raid.service has finished successfully.
░░
░░ The job identifier is 70.
Mar 08 23:10:04 nixos systemd[1]: Reached target ZFS pool import target.
░░ Subject: A start job for unit zfs-import.target has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit zfs-import.target has finished successfully.
░░
░░ The job identifier is 69.
Mar 08 23:10:04 nixos systemd[1]: Starting Mount ZFS filesystems...
░░ Subject: A start job for unit zfs-mount.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit zfs-mount.service has begun execution.
░░
░░ The job identifier is 67.
Mar 08 23:10:12 nixos systemd[1]: Finished Mount ZFS filesystems.
░░ Subject: A start job for unit zfs-mount.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit zfs-mount.service has finished successfully.
░░
░░ The job identifier is 67.
Mar 08 23:10:12 nixos systemd[1]: Reached target Local File Systems.
░░ Subject: A start job for unit local-fs.target has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit local-fs.target has finished successfully.
░░
░░ The job identifier is 21.
Also, just retried the legacy way, set all filesystems to legacy. The only mounted filesystems I got after boot, interestingly, were the same as non-legacy way (raid, raid/db, raid/conf, raid/docker), plus raid/home, which, unexpectedly, mounted to the bind mountpoint, but not original mountpoint.
And from console log, the missing mounts were “mounted”.
Reached target ZFS po [ OK ]
Mounted /mnt/data. Mounting /mnt/data/backup... Mounting /mnt/data/conf... 09 CI Express Gigabit Server Adapter). Mounting /mnt/data/conf... Mounting /mnt/data/docker... Mounting /mnt/data/downloads... Mounting /mnt/data/home... Mounting /mnt/data/upload... [ OK ]
Mounted /mnt/data/backup. [ OK ]
Mounted /mnt/data/db. ation. [ OK ]
Mounted /mnt/data/db.