How to Force‑Unmount a Busy NFS Share on Linux: Step‑by‑Step Guide
This guide explains why NFS mounts can become "device busy", shows how to locate the processes holding the mount with lsof and fuser, demonstrates safe termination of those processes, and covers both regular and lazy unmount techniques to reliably release the filesystem.
When an NFS mount reports “device is busy”, you must identify and stop the processes using the mount point before forcing an unmount.
Using lsof
The lsof command lists all open files on a specific filesystem, revealing which processes are accessing the NFS directory. # lsof /mnt/nfs/linoxide_srv/ Typical output shows processes such as bash and vim with their PIDs. After confirming that the user has saved work, you can terminate the processes:
# kill -9 24098 # kill -9 24125Using fuser
The fuser command identifies processes that prevent unmounting. Use the -m option to specify the mount point and -v for a verbose listing. # fuser -mv /mnt/nfs/linoxide_srv/ Output displays the user, PID, access mode, and command. To kill all processes accessing the mount point, add the -k option:
# fuser -kmv /mnt/nfs/linoxide_srv/Standard unmount
After terminating the interfering processes, attempt a normal unmount: # umount /mnt/nfs/linoxide_srv/ If successful, df -h will no longer list the mount point.
Lazy (delayed) unmount
If the mount remains busy, you can perform a lazy unmount with the -l flag. This removes the mount from the namespace while allowing existing references to continue until they close. # umount -l /mnt/nfs/linoxide_srv/ Check the exit status ( echo $?) – a zero indicates success. Verify the mount point is gone with df -h.
Using lsof and fuser to locate and terminate blocking processes, followed by a regular or lazy unmount, reliably resolves "device is busy" errors on NFS mounts.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
