Unmouting stale NFS mountpoint in linux

Unmounting stale NFS mount points in Linux can be royal pain sometimes. In Solaris, umount -f does the job just fine.

Linux on the other hand seems to get stuck if you use only -f switch. It just hangs there until you reboot the system.

If you use lazy umount, that will probably help you to avoid reboot:

root@ultra:/# umount -f -l /home/data

From Linux umount man page:

Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)

As the man page indicates this switch has been around since kernel version 2.4.11, which has been quite a while now. Maybe I should always finish reading the man pageā€¦