Stale NFS File Handle

We had some fun and games with our house server recently, when one of its disks died horribly*. I’ve only just got around to sorting out the backups again now, which use an external USB hard drive and rsnapshot. I started by reading my earlier rsnapshot post and also the one about the gotcha with mounting external drives. And yes, I do use this blog instead of a working human memory, much easier to find things.

When I mounted the drive, I saw I had one of the older daily.* directories with question marks for its name, date, permissions and so on when I ran ls. When I tried to do anything with the directory, I got the error stale NFS file handle, which was interesting since we don’t use NFS. After some looking around, I got the recommendation to run fsck.

Before running fsck, the drive must be unmounted.

Then, since mine was sdb1 I ran:

fsck -y /dev/sdb1

The -y switch asks fsck to try to fix every problem it encounters (this was quite a life saver, there were thousands of them before I stopped holding my finger down on the “y” key!) – it comes with warnings that experts may do better to fix manually, but really that’s not me.

The disk is now fine and the backups run fine, I guess it was just the old disk on its way out copying nonsense onto the external drive during backups.

* The stupid thing then blew up its power supply and took the UPS with it a week later, but that’s the way the cookie crumbles.

One thought on “Stale NFS File Handle

  1. Must be something in the air this month. My external HD died this month.

    Tripping over the cable, making it fall over, might not have helped.

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.