Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have Ubuntu and CentOS clients nfsv3 mounting to a FreeBSD box, which got rebooted while the nfs clients were connected. Now the clients get a permission denied when they try to access the mount points.

On the client I have tried

# umount /nobackup/dat
umount.nfs: /nobackup/dat: device is busy
umount.nfs: /nobackup/dat: device is busy

# fuser /nobackup/dat
Cannot stat file /proc/1660/fd/473: Stale NFS file handle
Cannot stat file /proc/1660/fd/475: Stale NFS file handle
Cannot stat file /proc/1660/fd/476: Stale NFS file handle
Cannot stat file /proc/1660/fd/478: Stale NFS file handle
Cannot stat file /proc/1660/fd/479: Stale NFS file handle
Cannot stat file /proc/14509/fd/1: Stale NFS file handle
Cannot stat file /proc/14674/fd/1: Stale NFS file handle
Cannot stat file /proc/14871/fd/1: Stale NFS file handle
Cannot stat file /proc/27872/fd/436: Stale NFS file handle
Cannot stat file /proc/27872/fd/444: No such file or directory

# umount -f /nobackup/dat
umount2: Device or resource busy
umount.nfs: /nobackup/dat: device is busy
umount2: Device or resource busy
umount.nfs: /nobackup/dat: device is busy

Update

Now I have killed all the processes and successfully unmounted /nobackup/dat, but I still get the permission denied error for some reason.

# fuser -m /nobackup/dat 2>&1 | awk -F'/' '{print $3}' | xargs -n 1 kill
# fuser -m /nobackup/dat
# umount -l /nobackup/dat
# ll /nobackup/dat
ls: cannot open directory /nobackup/dat: Permission denied

# mount /nobackup/dat
mount.nfs: access denied by server while mounting (null)

Question

Any suggestions how to debug this?

share|improve this question
    
I'd start by unmounting and remounting the nfs shares. –  Jenny D Dec 16 '13 at 12:58
    
@JennyD Good point. Ihave updated the OP, as this gives me a "Stale NFS file handle". –  Sandra Dec 16 '13 at 13:07

1 Answer 1

up vote 4 down vote accepted

The problem is that the clients didn't realise that the nfs server went away, so they're still trying to access the filehandle that was originally created the previous time they mounted the file system.

Normally, rebooting the client is a sure way of making it remount the file systems. But if you don't want to do that, start by killing all processes that are trying to use the NFS file systems. After that, you can try a "lazy umount" with

umount -l

You might also try to remount the filesystem, using

mount -o remount 

Otherwise, the old file handles will timeout at some point, though I don't know how long it will take.

Once you've successfully gotten rid of the stale filehandles, remount the filesystems:

mount nobackup/dat
share|improve this answer
    
Very nice. I have killed the processes, but still get permission denied. See updated OP. Any idea what is going on? –  Sandra Dec 16 '13 at 14:18
    
You need to also mount the file systems again –  Jenny D Dec 16 '13 at 14:18
    
Updated the OP when trying to mount it again. –  Sandra Dec 16 '13 at 14:22
1  
Check the export rules on the server. You may need to restart the NFS daemon on the server. –  Jenny D Dec 16 '13 at 14:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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