Solaris NFS stale filehandle

I had a stale NFS filehandle today on an old Solaris 8 server, here is how I resolved the problem.

First, here is a brief overview of NFS filehandles.

NFS Clients will not be able to access an NFS share if the NFS filehandle has changed, making the filehandle stale if the directory was removed or replaced or renamed, making it unaccessible on the NFS server.

  • If a file was deleted and replaced with a file of the same name, the file would have a new inode and the server would generate a new NFS file handle for the new file.
  • If a file was renamed, the file handle would remain the same.
  • If the NFS server is rebooted, then the NFS filehandle would remain the same.
  • With the issue I experienced, none of the usual situations above applied.

    The inode remained the same, and therefore the NFS generated filehandles will remain the same.

    On the NFS Server I exported a filesystem, say called /data/korea/seoul, deported a VxVM diskgroup containing this filesystem which is NFS shared, performed some work and then re-imported the VxVM diskgroup, started the volume and then mounted the filesystem.

    When I deported the VxVM diskgroup, I did’nt know that the filesystem was shared over NFS.

    This is what I saw, and how I fixed it.

    NFS Client – with auto-mounting configured

    $ cd /dat/korea
    ksh: /dat/korea: permission denied
    
    $ ypcat -k auto.dat | grep korea
    korea -fstype=nfs,rw,soft nfsserver:/data/korea/seoul
    

    NFS Server

    # unshare /data/korea/seoul
    # share -F nfs -o rw -d "my description here" /data/korea/seoul
    

    NFS Client

    $ cd /dat/korea
    $
    

    If that fails, restart the NFS daemon, if possible depending upon other NFS exports.

    Use DTrace (if Solaris 10) to see what’s going on.

    And if that fails, you need to restart the system which hosts the NFS server.

    Advertisements
    This entry was posted in solaris. Bookmark the permalink.

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s