I originally asked:
>
> we get NFS write error on host xxxx: Stale NFS file handles
> then a list of the file handles
>
> Question:
>
> under Solaris 2.3 how do I translate the file handles to file names?
> I believe it was possible under 4.1.x using showfh but Solaris...
>
I had two replies as follow - Thanks
-------------------------------------------------------------------------
From: Kevin.Sheehan@uniq.com.au (Kevin Sheehan {Consulting Poster Child})
>snoop on the machine sending the requests should be able to tell you that.
Yes as long as something is still trying to access the file
-------------------------------------------------------------------------
From: william.price@bell-atl.com
>The Following script was provide by Sun Support. I have not had
>any luck with it. It always says the file id (from mnttab) is
>not valid. If it works better for you great, please let me know!
Yes it did work after I changed all {} to [] (this may have been converted by
our mail system) and added the double quotes for the tr
#!/bin/sh
#
# fhfind: takes the expanded filehandle string from an
# NFS write error or stale filehandle message and maps
# it to a pathname on the server.
#
# The device id in the filehandle is used to locate the
# filesystem mountpoint. This is then used as the starting
# point for a find for the file with the inode number
# extracted from the filehandle.
#
# If the filesystem is big - the find may take a long time.
# Since there's no way to terminate the find upon finding
# the file, you may need to kill fhfind after it prints
# the path.
#
if [ $# -ne 8 ]; then
echo
echo "Usage: fhfind <filehandle> e.g."
echo
echo " fhfind 1540002 2 a0000 4df07 48df4455 a0000 2 25d1121d"
exit 1
fi
# Filesystem ID
FSID1=$1
FSID2=$2
# FID for the file
FFID1=$3
FFID2=`echo $4 | tr "[a-z]" "[A-Z]"` # uppercase for bc
FFID3=$5
# FID for the export point (not used)
EFID1=$6
EFID2=$7
EFID3=$8
# Use the device id to find the /etc/mnttab
# entry and thus the mountpoint for the filesystem.
E=`grep $FSID1 /etc/mnttab`
if [ "$E" = "" ] ; then
echo
echo "Cannot find filesystem for devid $FSID1"
exit 0
fi
set - $E
MNTPNT=$2
INUM=`echo "ibase=16;$FFID2" | bc` # hex to decimal for find
echo
echo "Now searching $MNTPNT for inode number $INUM"
echo
find $MNTPNT -mount -inum $INUM -print 2>/dev/null
Regards,
Karl J Mumford
____/ ____/ __ / ____/ Robert Bosch Strasse 5
/ / / / / 64293 Darmstadt, Germany.
/___/ ___ / / / / Phone: +49-6151-90-2413
/ / / / / Fax : +49-6151-90-3503
____/ ____/ _____/ _____/ Email: kmumford@esoc.esa.de
European Space Operations Centre : kmumford@esoc.bitnet
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:23 CDT