Linux – Unmount a nfs mount where the nfs server has disappeared

disaster-recoverylinuxnfs

Server A used to be a NFS server. Server B was mounting an export of that. Everything was fine. Then A died. Just switched off. Gone. Vanished.

However that folder is still mounted on B. I obviously can't cd into it or anything. However umount /mnt/myfolder just hangs and won't umount. Is there anyway to umount it without restarting B?

Both client and server are Linux machines.

Best Answer

Assuming Linux:

umount -f -l /mnt/myfolder

Will sort of 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.)

-f also exists on Solaris and AIX.