Como posso resolver um handle nfs obsoleto?

7

Eu notei uma vez quando desliguei meu servidor doméstico enquanto minha área de trabalho estava conectada via NFS e ficava recebendo "aviso de manipulação de NFS obsoleto" ao entrar no diretório home, isso causava problemas em alguns programas que olhavam nessas pastas.

Como resolvo esse problema sem reiniciar minha máquina?

Debian Squeeze / Wheezy

    
por yakamok 12.04.2012 / 12:09

3 respostas

3

No Debian Squeeze / Wheezy:

Forçar desmontar a montagem local

umount -f /mnt/dir

Em seguida, reinicie o nfs

/etc/init.d/nfs-common restart
    
por 13.04.2012 / 07:20
2

Tente este script de shell. Funciona bem para mim:

#!/bin/bash
# Purpose:
# Detect Stale File handle and remove it
# Script created: July 29, 2015 by Birgit Ducarroz
# Last modification: --
#

# Detect Stale file handle and write output into a variable and then into a file
mounts='df 2>&1 | grep 'Stale file handle' |awk '{print ""$2"" }' > NFS_stales.txt'
# Remove : ‘ and ’ characters from the output
sed -r -i 's/://' NFS_stales.txt && sed -r -i 's/‘//' NFS_stales.txt && sed -r -i 's/’//' NFS_stales.txt

# Not used: replace space by a new line
# stales='cat NFS_stales.txt && sed -r -i ':a;N;$!ba;s/ /\n /g' NFS_stales.txt'

# read NFS_stales.txt output file line by line then unmount stale by stale.
#    IFS='' (or IFS=) prevents leading/trailing whitespace from being trimmed.
#    -r prevents backslash escapes from being interpreted.
#    || [[ -n $line ]] prevents the last line from being ignored if it doesn't end with a \n (since read returns a non-zero exit code when it encounters EOF).

while IFS='' read -r line || [[ -n "$line" ]]; do
    echo "Unmounting due to NFS Stale file handle: $line"
    umount -fl $line
done < "NFS_stales.txt"
#EOF
    
por 29.07.2015 / 10:06
0

Normalmente, eu enviaria esses comandos (como root ):

service nis restart
service autofs restart
service nfs restart
service portmap restart

Você pode não precisar de todos, dependendo de como o seu sistema funciona.

    
por 12.04.2012 / 13:04

Tags