Beiträge von mike_t2

    Hi MrWhippy,


    I've had the same problem, not only with Docker but also with NFS.


    There are binds defined in the /etc/fstab pointing into your ZFS directory which are created by the serivces and the are mounted earlier than the ZFS mount.
    Thus this will fail then because the folder is not empty.


    On my system (OMV 3.x) these entry will also remain in /etc/fstab after disabling the service, maybe they remain also when uninstalling it.


    My Workaround for the ZFS/NFS/DOCKER mount problem is:
    1. Adding "noauto" the every "bind" entry pointing to ZFS directory in /etc/fstab :

    ..

    /ZFS_Mountpoint/Dokumente /export/Dokumente none noauto,bind,nofail,_netdev 0 0
    /ZFS_Mountpoint/Docker /var/lib/docker/openmediavault none noauto,bind,defaults 0 0
    ...
    ...


    So it will not mount the binds on boot and your ZFS directory remains stll empty until ZFS mount will be done.




    2. I've created a oneliner script "/usr/local/bin/mount_binds.sh":



    Bash
    #!/bin/bash
    
    
    for i in `cat /etc/fstab | grep bind | grep ZFS_Mountpoint | awk -F " "   {'print $1'}` ;  do mount $i  ; done

    Please edit "ZFS_Mountpoint" according your ZFS directory.


    Make it executable with:
    chmod 755 /usr/local/bin/mount_binds.sh


    It will find the "bind" entries pointing to my ZFS directory in /etc/fstab and mount it then.



    3. I've created a systemd service "/lib/systemd/system/mount_binds.service" to load the script on boot:



    Set access rights:


    chmod 644 /lib/systemd/system/mount_binds.service


    First I've tested it with:
    systemctl start mount_binds.service


    After it successfully has mounted my binds I've enabled it with:
    systemctl enable mount_binds.service



    After this modification all my ZFS Directories will be mounted on boot and Docker and NFS service both are working.
    So my server is reboot-safe.



    There's also a solution with adding "x-systemd.requires=zfs-mount.service" but my systemd don't know about that flag.
    Maybe because it's not the newest but can't update because it want to install kernel 4.x and I'm on 3.16 because of iSCSI.



    Best regards,
    Mike