Beiträge von gron

    @hurricanehrndz, I just tried your solution.
    It works for me now! but I did not see at once that I had to add my sharedfolders mounts behind the "Before=" (and I will have to do so each time I'll add a share in OMV...). I also changed "for i in {1..5};" to "for i in {1..300};", just in case. I don't care if my boot is slow.


    FYI I have another service based bon the same principle that do uncrypt my disks, retrieving the key with a ftp from another machine on the LAN, and that was this service that was causing late mergerfs mounting...


    Thank you!


    I have two remarks for whoever reads this:
    - I have Docker and Virtualbox installed - and they start before the sharefolders are mounted. to delay their start as much as possible, I added them to the before= list of the mergerfs wait service...
    - Also, I saw that nfs.service starts very early, just after network.target local-fs.target. What happens if the share is on snapraid? - btw I didn't check for CIFS.

    I spent quite a while on systemd - and I finished by modifying fstab because the same "after=" clause put in the systemd ".mount" files generated automaticaly by openmediavault has no effect, and on the contrary, works when put in fstab, like that :
    /srv/UnionFSfolder/ShareName /sharedfolders/ShareName none x-systemd.after=srv-dev\x2ddisk\x2dby\x2dlabel\x2dsde\x2dZAD66MV5.mount,bind,nofail 0 0


    "x-systemd.after=" tells "/lib/systemd/system-generators/systemd-fstab-generator", which translates fstab to systemd ".mount" files at boot time, to mount after "x2dZAD66MV5.mount", which is the last disk of my array, has been mounted, so I am sure the UnionFS is set.


    You can find the target ".mount" file name ("srv-dev\x2ddisk\x2dby\x2dlabel\x2dsde\x2dZAD66MV5.mount" in my example - set it to your disk) in "/run/systemd/generator".


    Of course, I renamed the "sharedfolders-*.mount" files in "/etc/systemd/system" so that they are not taken into account at boot time.