Solved: NFS mount unmounts on its own

  • I run OMV in a Proxmox VM. I have a USB hard drive connected to the host to use as a backup disk, but it is also my media disk. I have mounted it to a LXC container which then shares it over NFS so other VMs can access it. OMV mounts that NFS share and I use it in the many Docker services running on OMV. This works well, but the problem is that the NFS share often unmounts on OMV's side and practically disappears. The share on the LXC container is active when I try access it, but it is not mounted in OMV.


    First I was mounting it in OMV using `/etc/fstab` and the fix was to just run `mount -a` whenever I noticed it unmounted or via a cron job. I then tried the official OMV-extras NFS mount extension, but the problem persists and with it even `mount -a` doesn't re-mount it.


    How could I troubleshoot what is going on? Are there any relevant logs in OMV or NFS in general? Could it be some NFS timeout variable either in the sharing LXC container or the mounting OMV VM?


    Many thanks

    • Official Post

    What version of OMV? The remotemount plugin should be remounting it automatically if it detects it is unmounted but only on OMV 7.


    I don't have any idea how you have nfs setup in the lxc container but nfs won't unmount after a timeout unless you are using autofs (the remotemount plugin doesn't).


    Why don't you have the OMV VM provide NFS? That is exactly what it is designed to do. I get that storage is "easier" with LXC but that is when I would tell you to run OMV on the host and use the KVM plugin for VMs.

    omv 7.6.0-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.1 | kvm 7.0.16 | compose 7.3.3 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


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


    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!

  • It's OMV 6.9.16-1. I need the hard disk to be mounted on the Proxmox host for VM & LXC backups. Thus, I cannot mount it simultaneously through to the OMV VM and need to use NFS.


    Are you saying that NFS is meant to disconnect from time to time? Can I change it on the sharing side (on the LXC)? Since mount -a in OMV was fixing it, I suspect the LXC is sharing it fine. Although it is not clear what triggers the disconnect. I remember trying to force the HDD to go to sleep by tinkering with some packages but I can't remember what it was and whether it was in Proxmox, LXC or OMV... Could that be causing it?

    • Official Post

    It's OMV 6.9.16-1.

    Upgrade to 7.x and it will be better. It still won't fix why it is unmounting but at least it will automatically remount.

    Are you saying that NFS is meant to disconnect from time to time?

    Nope. It definitely shouldn't.

    Can I change it on the sharing side (on the LXC)?

    Unless the container is restarting, I don't know how you would configure nfs to disconnect on the server side.

    Since mount -a in OMV was fixing it, I suspect the LXC is sharing it fine. Although it is not clear what triggers the disconnect. I remember trying to force the HDD to go to sleep by tinkering with some packages but I can't remember what it was and whether it was in Proxmox, LXC or OMV... Could that be causing it?

    I don't sleep my drives but I would imagine that could cause it.

    omv 7.6.0-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.1 | kvm 7.0.16 | compose 7.3.3 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


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


    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!

  • Thanks - I will try OMV7.

    I just looked at the logs after the latest unmounting. On OMV the NFS logs are:

    Code
    nfs-server.service - NFS server and services
         Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
         Active: inactive (dead)
    
    Jun 26 08:03:32 omv-t630 systemd[1]: Dependency failed for NFS server and services.
    Jun 26 08:03:32 omv-t630 systemd[1]: nfs-server.service: Job nfs-server.service/start failed with result 'dependency'.

    and

    It seems like the NFS service is dying on OMV for some reason. Any guesses?

    • Official Post

    No. maybe a filesystem and/or networking wasn't ready? Can't tell from those logs.

    omv 7.6.0-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.1 | kvm 7.0.16 | compose 7.3.3 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


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


    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!

  • Unfortunately, upgrading to OMV7 didn't help. I saw that I had installed hd-idle on the Proxmox host. Could that be causing the NFS unmounting?

    • Official Post

    Never used it but maybe.

    omv 7.6.0-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.1 | kvm 7.0.16 | compose 7.3.3 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.0.9


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


    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!

  • Solved! It was a pretty niche set of circumstances. The machine is set up in a location with random intermittent 1sec power cuts, so it was running with a UPS. It turned out the UPS batteries had gone and when the power flickered the machine rebooted. The problem then was that I hadn't set a proper boot order for the containers and VMs in Proxmox. Thus, sometimes the OMV VM would boot before the LXC sharing the NFS. I set the LXC to boot first and the problem is gone!

  • sdywv

    Changed the title of the thread from “NFS mount unmounts on its own” to “Solved: NFS mount unmounts on its own”.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!