19

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
    Oct 20 '12 at 1:24
  • @jpetazzo Check out my answer below, I finally was able to resolve this issue for myself without needing a reboot May 31 '19 at 23:22
6

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? Apr 19 '13 at 9:48
  • -l has worked (instantaneously) when -f hasn't. Dec 4 '19 at 20:25
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.