Xupeng's blog

圆外之大,心向往之

Unmount the unreachable NFS volume

I previously mounted one NFS volume from the NFS server, but now the NFS server is down, then I have problem with “df” command to see the disk space usage information from my computer, now the only thing I want to do is to unmount the unreachable NFS volume.

The NFS volume is mounted at /mnt/nfs, when I try to unmount the NFS volume, I am told that it is busy, so I use lsof /mnt/nfs to find out the process using it normally, but lsof gets stuck and it never return the shell prompt to me. Ok, then I use fuser -9 -k /mnt/nfs, try to kill the process forcefully, but fuser gets stuck too…

All methods I normally use to unmount a volume fail, so I go back to RTFM, and I get two interesting options of umount:

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

Good, it looks like what I need, but unfortunely I fail with umount -f /mnt/nfs all the same, so I move on to another option:

1
2
3
-l     Lazy unmount. Detach the filesystem from the filesystem  hierar‐
       chy now, and cleanup all references to the filesystem as soon as
       it is not busy anymore.  (Requires kernel 2.4.11 or later.)

Wow! It works like a charm! That’s it: “umount -l /mnt/nfs”, maybe it will never be a pain to face a unreachable NFS volume again.

Comments