How to unmount NFS when server is gone?

You can use umount -f -l /mnt/myfolder, and that will fix the problem.

  • -f – Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1.116 or later.)

  • -l – 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.)

Source:Linux Complete Command Reference


try sudo umount -l {mountPoint} to do a "lazy unmount". Lets you move on with your life without waiting for the plumber to arrive.


In my case where umount -f did not work, umount -fr worked. -r argument remounts as read-only and then unmounts the folder.

Tags:

Nfs

Unmount