Plugin remote-mount - Auto mount & reload shared folder after network failure

  • Hello :).


    I have installed the plugin remote-mount and setup a remote mount from a windows share via CIFS.
    It's works fine.


    I have a problem with a scenario :
    - The case of OMV start before that my share is accessible on the network or after a during a network failure, my remote mount is not mounted in OMV.
    --> So i execute the command mount -a and it's works fine (disk is OK in filesystem menu of OMV) BUT share folder created on the remote mount are empty.
    It's like the shared folder managed by OMV is not reload. How can i automate remount of remote share and reload shared folder ?


    Can you help me ?


    Thx a lot

    • Offizieller Beitrag

    I use autofs and nfs. Works fine. A bit fiddly to setup the first time. Should work with CIFS as well, but I never tried it.


    Correctly setup autofs connect to the remote share automatically when you try to access it. Amazing! I have a bunch of Odroid HC2 and it would be chaos to have them access each other without autofs. I also use autofs on my laptop and on my PC. Just convenient.


    There are instructions on howto setup autofs if you Google autofs. I belive I used some Red Hat howto the first time. Now I just install autofs on the box and copy/edit the config files.


    Note: This is completely outside OMV.

    • Offizieller Beitrag

    Here are the changes I made to the autofs config files in /etc. Note that this is for nfs. You have to figure out how to do it for CIFS, If you do, please post your changes here.


    I created a nfs mount folder at /media/nfs. The auto mounted folders appear there.


    auto.master - a lot of comments and last line
    /media/nfs /etc/auto.nfs --ghost


    --ghost means that empty folders are shown. When you use them they are mounted.


    If I tried to use /media directly I couldn't get it to work.


    auto.nfs - the mount options for the remote shared folders
    nas1 -fstype=nfs4,hard,intr,nodev,nosuid,async,fsc,rsize=131072,wsize=131072 192.168.1.101:/export/nas1
    nas2 -fstype=nfs4,hard,intr,nodev,nosuid,async,fsc,rsize=131072,wsize=131072 192.168.1.102:/export/nas2
    nas3 -fstype=nfs4,hard,intr,nodev,nosuid,async,fsc,rsize=131072,wsize=131072 192.168.1.103:/export/nas3
    nas4 -fstype=nfs4,hard,intr,nodev,nosuid,async,fsc,rsize=131072,wsize=131072 192.168.1.104:/export/nas4
    synology -fstype=nfs4,hard,intr,nodev,nosuid,async,rsize=131072,wsize=131072 192.168.1.121:/volume1/nas


    When nas1 is mounted it appears as /media/nfs/nas1


    Also see: https://access.redhat.com/docu…uide/s2-nfs-config-autofs


    Again: This is all done outside OMV. But it works fine on my OMV NASes.

    • Offizieller Beitrag

    I believe autofs works perfectly fine for CIFS. Just a little different configuration and options. You use auto.smb for instance. And perhaps /media/smb.


    You just need to google "use autofs with cifs"


    For instance this looks interesting:


    https://www.howtoforge.com/acc…samba_shares_using_autofs

    • Offizieller Beitrag

    Instead of using autofs (sorry, not a fan), maybe OMV should use systemd's automount feature since it is already using mount unit files for the /sharedfolders bind mounts. I will have to look into this.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    It would be great if the remote mount plugin could use some auto mounting mechanism. I agree that autofs is a bit fiddly. But when setup it works great. Very convenient. And something like that is almost a must if you have several servers that mount shares from each other.


    I'll check out the systemd automount you mentioned.

    • Offizieller Beitrag

    I use shared folder on my CIFS mount, so i dont think that autofs autmatically reload OMV for my shared folder even if i use NFS.

    This may be easier than I thought. Just add ,noauto,x-systemd.automount after nofail in your remote mount options box and reboot. Let me know if that works.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    I'll check out the systemd automount you mentioned.

    If you have a setup, try out the part in my previous post. Curious if that works for you. i would make it the plugin default if it does.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    Brave! Make sure to have a current system backup

    There is very little risk in using this.

    My remote share is automount when the share is available on the network. BUT my shared folder keep empty (even if the share was already accessible before OMV boot).

    Not sure what that means. Does it mount the share if the remote server is not up at boot? I will need to setup a test environment I guess.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • With these option ,noauto,x-systemd.automount.
    The remote mount is auto mount when it is accessible on the network (ex with network failure or before OMV boot before my remote share). It was not the case before, sooo good news.
    But the shared folder managed by OMV stay empty even if the remote mount is accessible or not before OMV boot (it was not the case without using these options).

    • Offizieller Beitrag

    The remote mount is auto mount when it is accessible on the network (ex with network failure or before OMV boot before my remote share). It was not the case before, sooo good news.

    That is a good start. I need to do more testing but I think we can use systemd automount in more places to fix this. I also added the following lines to /usr/share/openmediavault/mkconf/systemd.d/sharedfolders after line 75:

    then
    omv-mkconf systemd
    This creates an automount file for each sharedfolder bind mount. I still don't think this will completely fix the problem but it helps. I should be able to figure the rest out with a test environment.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    Do yu have some news about my problem ?

    I haven't had a chance to work on it any further.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!