Hi,
my setup is as follows:
- ZFS pool /pool0
- /pool0/Software/IrfanView is a “real-data” folder
- /view/pool0 is a “real-data” folder
- Pool is auto-mounted on startup
I intended to work around using Symlinks with mount --bind. I had no problems setting up the following bind mount: /view/pool0/IrfanView -> /pool0/Software/IrfanView . Done via shell, it lasts until I reboot the server.
My intention is to get a software repository up which could sync some “virtually visible” folder structures form the (big) main repository. To be clear: /pool0 are the “real files” and /view/pool0 should be the “virtual” view achieved by the bind mounts below that folder.
mkdir -p /view/pool0/IrfanView
mount --bind /pool0/sync/Install/IrfanView/ /view/pool0/IrfanView
After setting up, the contents of “IrfanView” appear correctly in the view:
Syncthing picks them up correctly:
Now I’m testing what happens on loosing the pool which underlies the mount --bind.
zpool export pool0
Syncthing announces everything as “deleted” to the other nodes. This is correct from Synchting’s perspective, but bad for me as everything has to be resynced later.
I’m now having this state on the /view/… folders.
Do you have any ideas for me how I could solve this. I’d wish Syncthing could detect this somehow but it seems difficult due to the nature of the mount point in /view/… which is an empty folder until anyone issues the “mount --bind” command after the pool re-mount again.
I thought about the .stfolder, perhaps I could mount --bind this too but it has the same drawback. Would it work for Syncthing’s code to allow .stfolder to be a symlink and then detecting the bad state of the “view folder” when the .stfolder symlink is dangling? Then I’d place .stfolder as a symlink to a dummy folder on the pool. Or is there a better way?
Sure, I could use scripting and systemd to try at least to ensure as max as possible the pool unmounts expectedly after a Syncthing service shutdown but in case of an error or apt-get dist-upgrade replacing the ZFS driver or delay in reboot I see my thing failing.
Regards, Catfriend1
4 posts - 2 participants