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

Drt
  • 404
  • 2
  • 6
  • 18
UsAaR33
  • 1,096
  • 3
  • 11
  • 20
  • 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 01:24
  • @jpetazzo Check out my answer below, I finally was able to resolve this issue for myself without needing a reboot – craymichael May 31 '19 at 23:22

3 Answers3

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.

Xupeng
  • 171
  • 4
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.

craymichael
  • 143
  • 4
1

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

fusermount -u /mnt/1
TheJJ
  • 123
  • 5