NFS share not visible in Linux client after OMV reboot

  • Hi all,


    I have OMV running on RPI4. I have LUKS HDD connected to it. I have configured SMB and NFS shares (HDD root dir for both).

    On Ubuntu clients (two very similar laptops) I occasionally have had issues with accessing NFS share after OMV restart. I think it was something to do with a cache or something as it usually came back after 48 hours or so.

    Last time it didn't, so I need your help please.


    OMV is IP 192.168.1.140 and hostname "rpi4". On my client machine an NFS part of /etc/fstab looks like that:


    192.168.1.140:/export/shared    /mnt/shared     nfs    auto,defaults,noatime,nodiratime,nolock,intr,tcp,actimeo=1800,_netdev,retry=3,nfsvers=3,rsize=65536,wsize=65536     0     0


    Tried also with nfsvers=4


    Or manually:


    sudo mount -t nfs rpi4:/export/shared /mnt/shared



    then


    df -h


    I can see a line:


    192.168.1.140:/export/shared    30G    2.2G    26G    8%    /mnt/shared


    which looks like OMV root fs (2.2GB used of 32GB card), not my HDD with data.


    Obviously /mnt/shared exists on both laptops.



    The below command:

    rpcinfo -p rpi4| grep nfs


    give me below result:


    100003 3 tcp 2049 nfs

    100003 4 tcp 2049 nfs

    100003 3 udp 2049 nfs


    showmount -e rpi4


    gives me:


    Export list for rpi4:

    /export 192.168.1.0/24

    /export/shared 192.168.1.0/24


    Also this:

    showmount -a rpi4


    gives me the result as below:

    All mount points on rpi4:

    192.168.1.111:/export/shared/backups/moode

    192.168.1.111:/export/shared/mp3

    192.168.1.196:/export/shared

    192.168.1.63:/export/shared



    Ubuntu laptops are IPs ...1.196 and ...1.63.

    IP ...1.111 is my moOde RPI player (mp3 / online radio, etc), but it's down at the moment (SD card failed).



    The SMB share works fine on Windows and Linux on two similar laptops


    Any ideas how to make NFS to work too?



    EDIT:

    Managed to restore mo0de from a recent backup to a new SD card. It also has problems to connect to an NFS share with music.

    I can see this in mo0de logs:


    20220817 232028 sourceMount(): Mount error: (mount.nfs: mounting 192.168.1.140:/export/shared/mp3 failed, reason given by server: No such file or directory)

    20220817 232028 sourceMount(): Mount error: (mount.nfs: mounting 192.168.1.140:/export/shared/backups/moode/ failed, reason given by server: No such file or directory)



    EDIT 2:

    Forgot to mention that currently I use latest OMV v6 (upgraded from v5, not a fresh install), but previously had the same issue with v5 as well if that helps.

    OMV7 on RPi4B, WD elements 4TB

    Edited 3 times, last by greg77: added extra info ().

  • Anyone?


    From what I could read seems like in OMV an NFS share list is not updated after a LUKS decryption. Looks like a pretty old problem (back from OMV 4.x).


    A few links below from OMV git repo:

    https://github.com/OpenMediaVa…-luksencryption/issues/13

    https://github.com/openmediavault/openmediavault/issues/871


    and one from this forum:



    At the moment I've switched to SMB in Linux clients, but ideally would love to come back to NFS.

    OMV7 on RPi4B, WD elements 4TB

    • Official Post

    Does sudo systemctl restart nfs-server fix the issue after unlocking luks?

    omv 7.7.0-2 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.1 | kvm 7.0.17 | compose 7.3.4 | 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!

  • Does sudo systemctl restart nfs-server fix the issue after unlocking luks?

    Unfortunately it doesn't help.

    Same issue. ls command shows empty directory, df command shows space available in OMV root filesystem.


    You called your sharedfoleder "shared"? It's sounds a little bit strange for me.


    Why? It is a network share between a few machine we have at home. It's like HDD with various data people called "data_files", etc :D.

    Also calling it something different wouldn't solve my NFS problem :(.

    OMV7 on RPi4B, WD elements 4TB

    • Official Post

    Unfortunately it doesn't help.

    Then you need to restart your bind mounts. I would have to see your fstab to help with that.

    omv 7.7.0-2 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.1 | kvm 7.0.17 | compose 7.3.4 | 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!




  • and /etc/crypttab in case you want to see that too:


    Code
    # <target name>	<source device>		<key file>	<options>
    # sda1-crypt	UUID=43bd41f4-9a09-46bd-b981-7810676f9008	/run/cryptsetup/keyfile-elements1	luks,nofail

    OMV7 on RPi4B, WD elements 4TB

    • Official Post

    I would try: sudo mount -o bind,rw,remount /export/shared

    omv 7.7.0-2 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.1 | kvm 7.0.17 | compose 7.3.4 | 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!

  • I would try: sudo mount -o bind,rw,remount /export/shared

    I get an error as below:

    mount: /export/shared: mount point not mounted or bad option.



    EDIT:

    OK, the command worked without the "remount" part (that was the bad option which cause the previous error I guess). Now I ca list /export/shared and it shows the right content.


    However in a Linux client when I try sudo mount -a it says:

    mount.nfs: mounting 192.168.1.140:/export/shared failed, reason given by server: No such file or directory



    EDIT2:

    Just realized that it works on my other laptop which I use less and didn't change any fstab / nfs / smb settings recently.

    Will come back to the old settings on my main laptop, but I guess this is the solution.


    I don't restart OMV often, but it would be great to make it automated after OMV restart and unlocking LUKS.


    Thanks again for the solution!


    OMV7 on RPi4B, WD elements 4TB

    Edited 2 times, last by greg77 ().

  • I haven't had a chance to test the command yet (I choose not to restart my Odroid purposefully because of its strange issues with HDD detection), but I'll remember to try :)


    I don't restart OMV often, but it would be great to make it automated after OMV restart and unlocking LUKS.

    Untested, but here's what I'd try:

    • Login to the OMV's Linux shell
    • sudo nano /etc/systemd/system/remount-nfs-on-unlock.service
    • In the editor, paste this:
    Code
    [Unit]
    Description=Remount NFS shares once LUKS volumes are unlocked
    After=default.target
    
    [Service]
    ExecStart=/usr/local/bin/remount-nfs-on-unlock.sh
    
    [Install]
    WantedBy=default.target
    • sudo nano /usr/local/bin/remount-nfs-on-unlock.sh
    • In the editor, paste this: (you may need to refer to "Storage > Encryption" in OMV panel and replace the path in the 5th line of the script below with what you see in the "Decrypted Device" column)

    (thank you DimaKompot for this script)

    • sudo chmod a+x /usr/local/bin/remount-nfs-on-unlock.sh
    • sudo systemctl enable remount-nfs-on-unlock.service

    Server: Codename Oven (ASRock J5040-ITX with 4-core Pentium Silver J5040, 2x 8TB Seagate IronWolf HDD, inside Coolermaster Elite 110 case, powered by OMV 6)

  • I haven't had a chance to test the command yet (I choose not to restart my Odroid purposefully because of its strange issues with HDD detection), but I'll remember to try :)


    Untested, but here's what I'd try:

    • Login to the OMV's Linux shell
    • sudo nano /etc/systemd/system/remount-nfs-on-unlock.service
    • In the editor, paste this:
    Code
    [Unit]
    Description=Remount NFS shares once LUKS volumes are unlocked
    After=default.target
    
    [Service]
    ExecStart=/usr/local/bin/remount-nfs-on-unlock.sh
    
    [Install]
    WantedBy=default.target
    • sudo nano /usr/local/bin/remount-nfs-on-unlock.sh
    • In the editor, paste this: (you may need to refer to "Storage > Encryption" in OMV panel and replace the path in the 5th line of the script below with what you see in the "Decrypted Device" column)

    (thank you DimaKompot for this script)

    • sudo chmod a+x /usr/local/bin/remount-nfs-on-unlock.sh
    • sudo systemctl enable remount-nfs-on-unlock.service

    Great write-up! I just stumbled across the same issue and found this thread. Took 5 minutes to implement and works!!!

    THANK YOU! :D

Participate now!

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