Failed NFS unmounting on PVE shutdown

PapaGigas

Member
Mar 18, 2023
40
2
8
Hi everyone,

I'm running a TrueNAS VM with an NFS share for PBS, which I've mounted on PVE since PBS is on the same machine. Here’s how I set it up initially:

root@pve:~# mkdir -p /mnt/pbs/truenas
root@pve:~# nano /etc/fstab

ip:/path /mnt/pbs/truenas nfs defaults 0 0

root@pve:~# systemctl daemon-reload
root@pve:~# mount -a

This setup worked, but I encountered issues where it failed on boot, significantly increasing the boot time.

To address this, I modified the fstab entry like this:

ip:/path /mnt/pbs/truenas nfs nofail,defaults 0 0

Now it's working and booting fine. However, I’m seeing this error when shutting down PVE:

[FAILED] Failed unmounting mnt-pbs-truenas.mount - /mnt/pbs/truenas.

Has anyone else experienced this or know how to resolve it? Any help would be greatly appreciated. Thanks in advance! ;)
 
Last edited:
Hey,

this is likely due to PBS keeping the .lock file open. You can check with lsof /<DATSTORE>/.lock. If your installed version is at least 3.1.5-1 putting the datastore into "Offline" maintenance mode should clear this up. After setting it you can check with lsof again.
 
putting the datastore into "Offline" maintenance mode should clear this up.

It worked, but do I need to put it offline every time I want to reboot or shutdown PVE? :confused:

PS - if the datastore's not offline, PVE takes a bit longer because of this:

nfs_unmounting.jpg
 
Last edited:
The thing is you have to tell PBS it is not supposed to use the disk anymore, just pulling the disk out under its feet can lead to problems. In your specific case it is just a file handle for the lock file that is kept, but you'd have the same problem if a backup was running.
 
How can I notify PBS during a reboot or shutdown so it automatically sets the datastore to offline and brings it back online after startup?
 
I would also be interested in PBS automatically unmounting the nfs share on controlled host shutdown. At least I know I can speed things up by jumping around, but I'm really looking to not visit individual guests for controlled shutdowns.

Ironically it is set up with autofs, so is it only mounting just before shutdown, just to get locked and delay shutdown? Funny thought but wouldn't be surprised.