Force Remove a NFS Storage Repository
-
Good-day folks,
I have an old NFS storage repository that was previously hosted on a Windows Server 2016 machine running NFS Server for Windows, that is being stubborn and I would like to remove it forcefully, along with anything related to it. The NFS Server is no longer online, so the connection isn't alive and I suspect the removal is failing because XOA can't unmount it.
I have tried being nice by clicking the
Disconnect from all hosts
button, but the tasks sits there for several hours then mocks me and disappears. I have tried to unplug the connection from each host, one at a time, same results - the wheel spins for some time then goes away.Any assistance would be greatly appreciated, thanks.
My Environment:
Hosts: 3-node XCP-ng Pool v8.3.0
XOA: v5.106.4 build 20250604
Environment: Airgapped -
@tjkreidl said in Force Remove a NFS Storage Repository:
@kagbasi-ngc See if this thread can help you out:
https://xcp-ng.org/forum/topic/6618/how-to-remove-this-sr-nfs-storage/A BIG THANK YOU! This was quite helpful, and helped me resolve my issued.
Here's what I ended up doing (after reading the post you shared):
-
STEP 1: On each host, I ran the
mount
command (without any parameters). -
STEP 2: I identified the mount point of the SR in question - for me it was
/run/sr-mount/<SR-UUID>
-
STEP 3: On each host, I unmounted the NFS share with
umount -lf /run/sr-mount/<SR-UUID>
-
STEP 4: From the pool master, I identified the UUID of the PBDs with
xe pbd-list sr-uuid=<SR-UUID>
-
STEP 5: While still on the pool master, I unplugged each PBD with
xe pbd-unplug uuid=<PBD-UUID> force=true
(I had three to unplug, adjust accordingly) -
STEP 6: I confirmed in Xen Orchestra that the status of each host connection had changed to
Disconnected
-
STEP 7: From the pool master, I forgot the SR with
xe sr-forget uuid=<SR-UUID>
Hope this helps someone out there. Thanks again @tjkreidl
-
-
@kagbasi-ngc See if this thread can help you out:
https://xcp-ng.org/forum/topic/6618/how-to-remove-this-sr-nfs-storage/ -
@tjkreidl said in Force Remove a NFS Storage Repository:
@kagbasi-ngc See if this thread can help you out:
https://xcp-ng.org/forum/topic/6618/how-to-remove-this-sr-nfs-storage/A BIG THANK YOU! This was quite helpful, and helped me resolve my issued.
Here's what I ended up doing (after reading the post you shared):
-
STEP 1: On each host, I ran the
mount
command (without any parameters). -
STEP 2: I identified the mount point of the SR in question - for me it was
/run/sr-mount/<SR-UUID>
-
STEP 3: On each host, I unmounted the NFS share with
umount -lf /run/sr-mount/<SR-UUID>
-
STEP 4: From the pool master, I identified the UUID of the PBDs with
xe pbd-list sr-uuid=<SR-UUID>
-
STEP 5: While still on the pool master, I unplugged each PBD with
xe pbd-unplug uuid=<PBD-UUID> force=true
(I had three to unplug, adjust accordingly) -
STEP 6: I confirmed in Xen Orchestra that the status of each host connection had changed to
Disconnected
-
STEP 7: From the pool master, I forgot the SR with
xe sr-forget uuid=<SR-UUID>
Hope this helps someone out there. Thanks again @tjkreidl
-
-
-
O olivierlambert has marked this topic as solved
-
@kagbasi-ngc A fair warning that lazy unmount doesn't release the mount or any active file descriptors, just hides them from them from the mount output.
-
@Forza thanks for the caution. I wondered about that as well, so I initially tried with just -f and it didn't work. So this is what ended up working for me.
Perhaps one of the developers from the Vates team can chime in as to how best to handle such a situation properly; where the NFS Server is simple no longer online to support the normal unmounting routine.
-
@kagbasi-ngc As far as I know, Linux cannot release it without rebooting.
-
@Forza Good point. I need to apply the latest patches anyway, so I'll be rebooting the pool later today anyway.