21

Got myself into a tricky situation. Have aufs mounted at /mnt/1

aufs on /mnt/1 type aufs (rw,relatime,si=daab1cec23213eea)

I can't unmount the thing:

sudo umount -f /mnt/1
umount2: Stale NFS file handle
umount: /mnt/1: Stale NFS file handle
umount2: Stale NFS file handle
umount2: Stale NFS file handle

How do I unmount the mount point? (without rebooting the system)

(Note: aufs is on top of an openafs system rather than NFS.)

2
  • 5
    Got into a similar situation, and could reproduce it easily: just remove the rw branch of the AUFS filesystem, and boom, the AUFS mountpoint is completely hosed. umount -f or umount -l won't change a thing. I'm still looking for a solution as well.
    – jpetazzo
    Commented Oct 20, 2012 at 1:24
  • @jpetazzo Check out my answer below, I finally was able to resolve this issue for myself without needing a reboot Commented May 31, 2019 at 23:22

3 Answers 3

7

from man 8 umount:

   -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 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.)

If sudo umount -f /mnt/1 does not work, you can try sudo umount -l /mnt/1.

2
  • -l may take some time, right? Is there some additional option if -f doesn't work? Commented Apr 19, 2013 at 9:48
  • -l has worked (instantaneously) when -f hasn't. Commented Dec 4, 2019 at 20:25
4

Alright, I have found a solution for my issue (same as the question). This is what did NOT work for me:

  • mount -t nfs -o remount /mnt/1
  • umount /mnt/1
  • umount -f /mnt/1
  • umount -l /mnt/1

Here is what DID work for me:

  • umount -lf /mnt/1

If this does not work for you, ensure that you kill all processes currently tied to the mounted directory:

  • lsof | grep /mnt/1
  • fuser -k /mnt/1

The -l (lazy) option tells umount not to clean things up now. Without this option the mount point will be busy. Check out @Xupeng's answer for the man page details on the umount options.

1

You can unmount this, despite stale file handle, with:

fusermount -u /mnt/1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .