CTs and NFS Shares? (6min shutdowns/reboots) [Solved]

d3dl3g

New Member
Sep 10, 2023
23
2
3
Hi all,

i have recently (attempted) a move to NFS for my CTs. for this post i will be referencing my b0rked CT, but i have numerous others with identical issues.

I am using BTRFS. My files are shared via NFS from a "Fedora-Server" VM. Fedora VM is 2nd to come up after my router VM. so in a perfect world should always be present before and after CT boots/shutdowns. during all of my headaches the server is up and present (confirmed with "showmount -e <Fedora-Server IP>" from any given CT)
CT is running Proxmox Debian 12 Template (worthy of note because my Debian 11 CTs dont appear to have this issue)

Server /etc/exports:-
Code:
/mnt/btrfs/Media *(rw,no_subtree_check,no_root_squash)

CT /etc/fstab:-
Code:
Fedora-Server:/mnt/btrfs/Media /mnt/media nfs _netdev,rw 0 0

CT "mount" command from CLI:-
Code:
Fedora-Server:/mnt/btrfs/Media/ on /mnt/media/ type nfs4 (rw,relatime,vers=4.2,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=<CT IP>,local_lock=none,addr=<Fedora-Server IP>,_netdev)

i am seeing a 6 minute shutdown/reboot time of CT. Where as unmounting the NFS share will result in a <5sec shutdown.
i am unsure as to why as i believe a "timeo=600" is actually a 60 sec timeout (because "deci-seconds").

scrolling through manpages doesnt really clear the air for me as im a little confused as to why "mount" has so many additional options compared to exports/fstab.
"mount" gives "hard" option. which i think its best to be used with "intr" but im not 100% sure if i should set it on client or server side, if at all.

i have seen i *may* need to edit the systemd with "Before=mnt-<share>.mount" and "Required=mnt-<share>.mount"
but with other CTs i have not had much joy with this being the resolution.

i am happy to spool up "Test CTs" if needed, rather than working on my live kit and report findings

Any advice is warmly recieved, and greatly appreciated because im kind of scratching my head at this point.
 
Last edited:
... issue appears to have "fixed itself" i had to bounce my pve, due to an unrelated issue.

6 minute wait is no longer a thing. CTs reboot and shutdown in the <5sec as expected.

"turn it off.. turn it back on again"

thanks all for reading
 
further to this,.. but still solved,

"mp" mount points seem to fix all the issues for reboot/shutdowns moving forward.
 
Hi sb-jw,
Thanks for the reply, modding systemd files was absolutely an option for this, i think i just needed to figure out WHICH file i needed to mod.

With my issue lying with CTs, i found it a little more difficult to get any useful journal output or logs. (With a VM, on shutdown you can just press <esc> and it gives an idea about what stage its hanging up on).

The easiest option for me was to try different mount approaches. CIFS is sometimes way more hassle than it really should be, NFS within the CT was preferred, systemd wasnt really doing what i thought i was asking it to. "mp" really does seem like the right move at the moment.

```pct set <ctid> -mp0 <pve/local/dir>,mp=<ctid/local/dir>```