[SOLVED] NAS NFS shares after a power outage

FabioLeal

Member
Jul 26, 2022
12
3
8
I have 3 NFS shares with a NAS and they work quite well, but when there is a power outage, the NAS is configured to stay off and not start automatically, so as not to cause problems if the power keeps going back and forth.

The problem is that the machine with Proxmox does not have this configuration and when I turn the NAS back on, Proxmox does not find the shares and keeps returning the following messages in the log:
Feb 10 12:01:05 m920s pvestatd[1100]: unable to activate storage 'nas-series' - directory '/mnt/pve/nas-series' does not exist or is unreachable
Feb 10 12:01:15 m920s pvestatd[1100]: unable to activate storage 'nas-movies' - directory '/mnt/pve/nas-movies' does not exist or is unreachable
Feb 10 12:01:15 m920s pvestatd[1100]: unable to activate storage 'nas-music' - directory '/mnt/pve/nas-music' does not exist or is unreachable

Every time this happens, I test to see if the shares exist and they are working.
To solve the problem, I have to restart the server so it can find the shares again.

Is there a service, or something I can do, so that I don't have to restart the server?
 
This looks very similar to the CIFS issue I have been seeing, which occurs for the same reason.

Also wondering where the services are to restart them so PVE reconnects!
 
Hope you defined your nas storage by datacenter storage and not manually in fstab or ?
Normally a nfs client is waiting endless for the server coming back which work here (by us) fine too.
Maybe it's a misfunction (of the code as I assume you don't misconfigured it with not default settings) of your nfs server implementation on your nas.
 
Hope you defined your nas storage by datacenter storage and not manually in fstab or ?
Normally a nfs client is waiting endless for the server coming back which work here (by us) fine too.
Yeah... Defined by datacenter storage.

Maybe it's a misfunction (of the code as I assume you don't misconfigured it with not default settings) of your nfs server implementation on your nas.
There's some way to confirm? Some configuration that I should verify?
 
I don't want to clutter the thread, but if the OP's initial statement is correct, it's just like the CIFS shares. They work perfectly fine, except if you restart the host where they're being served-from. Then PVE does not reconnect. So the mount and the implementation are acceptable to PVE; it is PVE that will not reconnect after they're disconnected for some reason.
 
Normally pvs will reconnect nfs mounts as we have this 1-2 times a month for updates - so I strongly assume the problem isn't in pve as like every linux nfs client !!
 
Is your mount automatically v4.2 etablished (mount|grep nfs) ?
Probably (lol)...
Code:
root@SERVER-NAME:~# mount|grep nfs
NAS-IP:/export/Media-Music on /mnt/pve/nas-music type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=NAS-IP,mountvers=3,mountport=56858,mountproto=udp,local_lock=none,addr=NAS-IP)
NAS-IP:/export/Media-Series on /mnt/pve/nas-series type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=NAS-IP,mountvers=3,mountport=56858,mountproto=udp,local_lock=none,addr=NAS-IP)
NAS-IP:/export/Media-Movies on /mnt/pve/nas-movies type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=NAS-IP,mountvers=3,mountport=56858,mountproto=udp,local_lock=none,addr=NAS-IP)
 
I don't want to clutter the thread, but if the OP's initial statement is correct, it's just like the CIFS shares. They work perfectly fine, except if you restart the host where they're being served-from. Then PVE does not reconnect. So the mount and the implementation are acceptable to PVE; it is PVE that will not reconnect after they're disconnected for some reason.
Yeah. The connection is established normally, but when the NAS goes offline and comes back, the PVE does not reconnect by itself.
 
Normally pvs will reconnect nfs mounts as we have this 1-2 times a month for updates - so I strongly assume the problem isn't in pve as like every linux nfs client !!
I see... But in the monthly update that you mentioned, do you turn off or restart the NAS devices? Because my problem is when the NFS server goes down and comes back. PVE should connect automatically, but the log says that the NAS cannot be found.

As I mentioned in the initial post, I always test NFS to see if it is really down, but it is not.
 
That's nfs v3 export only and reconnection is often only done with "umount -l /share ; mount /share". Could you instead export in v4.2(/v4.1) ?
Our "nas" is a 2U 4core lenovo rack server with rocky9.5 and for booting stays huih quiet long in bios hw checks until the os begins to load again ... :)
 
@waltar
Your setup is too fancy for me. LOL

Thanks for the tip!

After updated the nfs version to 4.2, I did some tests by turning the NAS off and on again with PVE running. It seems to have worked. Changing the NFS version was a bit of work, but if it works, it was worth the effort.

My problem now is different, but I'll have to change some things when starting the NAS, so that the NFS service doesn't start before the drive is up.

I'll do some more tests and if everything works, I'll come back here and mark it as resolved.

Thanks again!
 
  • Like
Reactions: waltar
I haven't had any power outages since I created this post, but in my testing the problem seemed to no longer occur after changing the NFS version to 4.2.

TY again @waltar
 
  • Like
Reactions: waltar