Forcibly Unmounting NFS Filesystems
forcibly unmounting nfs filesystems
problem statement
3
problem
statement
Most attempts at unmounting hung NFS filesystems from an unavailable server fail with
an error such as “Device busy.” This typically occurs when client-side processes are
referencing NFS files or directories on the server at the time it went down or when client-
side processes continuously attempt to access NFS resources on the down server. These
processes must relinquish any references to the directory and its files before the NFS
unmount command will complete successfully.
Other system resources that count towards a filesystem being considered busy are things
like buffer cache memory pages, memory-mapped files, and page cache memory pages.
If these resources are associated with the NFS filesystem in question they will render the
filesystem busy. Therefore, any processes that have used buffer cache, page cache, or
memory-mapped resources associated with the NFS filesystem in question must relinquish
control of these resources before the filesystem can be unmounted.
Unfortunately, in most situations the processes holding NFS resources cannot be simply
killed because they are sleeping at an uninterruptible level in the kernel where they
cannot receive SIGTERM or SIGKILL signals.
Similarly, there are times when an NFS filesystem cannot be unmounted even when the
server is available because the client’s kernel believes the filesystem is “busy” – even
when there are no processes accessing the filesystem. Regardless of the cause, the end
result is the client system is unable to successfully unmount an NFS filesystem.
The most common course of action in these situations is to reboot the client system, thus
killing all running processes and releasing any remaining NFS and Virtual Memory
resources. Of course, this is a drastic solution and one that customers prefer to avoid at
all costs.
Given the disruptive nature and inherent downtime associated with rebooting client
systems, it should come as no surprise that one of the most frequently requested
enhancements submitted by NFS customers is the ability to forcibly unmount “hung” or
“busy” NFS filesystems without incurring any client downtime.
While HP-UX does not currently provide a direct means of forcibly unmounting
filesystems,
1
there are methods and procedures available that in some cases will allow
you to successfully unmount “hung” filesystems without requiring a client system reboot.
Likewise, there are precautions you can take to protect your HP-UX client systems from the
situation where NFS filesystems are considered “busy” when no processes are accessing
them.
1
As of HP-UX 11.23 (a.k.a. 11i v2).