1

I have four computers and on two of them (say it will be n1 and n2) I have installed NFS4 server and exported:

/export   10.0.0.0/16(rw,fsid=0,no_subtree_check,async,insecure,no_root_squash)
/export/home 10.0.0.0/16(rw,fsid=0,no_subtree_check,async,insecure,no_root_squash)

Now, both n1 and n2 has the same configuration and I can mount and unmount those resources on any of my computers (in /home/n1 and /home/n2) without errors, but I can access only resources from n1. When I try to ls directory from n2 I get error: "Stale NFS file handle".

My network is working correctly, I have no firewall, both of them has the same configuration and the same Ubuntu 10.04 server version.

On client machines in logs I get this error:

[585039.584017] NFS: server 10.0.1.4 error: fileid changed
[585039.584019] fsid 0:16: expected fileid 0x1ba54e2, got 0x3f20001

I've checked it on server machine and this 0x3f20001 is id of /export directory and 0x1ba54e2 is /export/home.

My fstab looks like this:

10.0.1.4:/home /home/n2 nfs4    _netdev,auto 0 0

IP 10.0.1.4 belongs to n2 host.

Any idea?

klew
  • 723
  • 2
  • 11
  • 16

2 Answers2

1

The fsid should be different for each export and it is set to 0 in your configuration.

You should try to set a different fsid for each export on each server.

jon_d
  • 683
  • 4
  • 7
  • Thanks I removed `fsid=0` from `/export/home` since manual says that NFSv4 should take care of it. – klew Feb 08 '11 at 12:22
1

It looks like it was problem with wrong bind in fstab. Earlier when I was setting it up I accidentally swapped src and dest in fstab on n2 when I binded it to /home/n2 then, I moved some home directories and changed this bind to correct one. But probably I didn't remount it (I must have forgotten to do so).

I tried updating packages and after restart I noticed that /export/home was empty and all the data was in /home/n2 on n2. So again I moved it to /export/home and everything was working correctly.

So I guess that NFS had problems with exporting a directory that was binded from other directory.

klew
  • 723
  • 2
  • 11
  • 16