Chinaunix首页 | 论坛 | 博客
  • 博客访问: 394378
  • 博文数量: 31
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 568
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-05 23:30
文章分类

全部博文(31)

文章存档

2011年(1)

2010年(2)

2009年(24)

2008年(4)

我的朋友

分类: LINUX

2008-12-21 15:33:53

by Vivek Gite [Last updated: May 14, 2008]

Sometime NFS can result in to weird problems. For example NFS mounted directories sometimes contain stale file handles. If you run command such as ls or vi you will see an error:
$ ls
.: Stale File Handle

First let us try to understand the concept of Stale File Handle. , 2nd Edition book defines filehandles as follows (a good book if you would like to master NFS and NIS):
A filehandle becomes stale whenever the file or directory referenced by the handle is removed by another host, while your client still holds an active reference to the object. A typical example occurs when the current directory of a process, running on your client, is removed on the server (either by a process running on the server or on another client).

So this can occur if the directory is modified on the NFS server, but the directories modification time is not updated.

How do I fix this problem?

a) The best solution is to remount directory from the NFS client using :
#
# mount -t nfs nfsserver:/path/to/share /mnt/local

First (umount) forcefully unmount a disk partition /mnt/local (NFS).

(b) Or try to mount NFS directory with the noac option. However I don't recommend using noac option because of performance issue and Checking files on NFS filesystem referenced by file descriptors (i.e. the fcntl and ioctl families of functions) may lead to inconsistent result due to the lack of consistency check in kernel even if noac is used.

阅读(2144) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~