[DRBD-user] how to avoid Stale NFS file handle with multiple drbds?

Brad Barnett lists at l8r.net
Sat Dec 10 13:46:06 CET 2005

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

On Wed, 7 Dec 2005 10:45:20 +0100
raoul at sgs.dfn.de (Raoul Borenius) wrote:

> Hi,
> has anyone succeeded in setting up multiple nfs-exported drbd-volumes
> without getting the 'Stale NFS file handle'-error during failover?
> Following http://linux-ha.org/DRBD_2fNFS I can export one drbd-volume
> with symlinked /var/lib/nfs which works perfectly without error during
> failover. But what do I need to do if I have two or more drbd-volumes on
> my nfs-server (which will be exported to different clients)?

I have to ask this, just in case you may be doing something strange. ;) 
If you have a large raid, there is no need to setup a separate partition
for each NFS export.  That is, if you have four NFS exports, they can all
live in the same directory on your raid/drbd device.. and be nfs exported
from there.

Now, I know you may have four different drives, non raided.. and that you
may be exporting them each.. but I thought I would mention the above, just
in case you thought each nfs export needed its own partition.

> /var/lib/nfs can only be symlinked to one of the volumes which
> means that I would get a 'Stale NFS file handle'-error during failover
> on all the other volumes.
> I've tried to set up /var/lib/nfs as drbd0 and then my data-volumes as
> drbd1, drbd2 etc. but that did not help.

It should help.  Is it that the drbd0 partition is not ready soon enough? 
I would think that heartbeat failover would mean that all drbd partitions
are ready, before NFS is started..

Do you know why this failed?  It seems like a logical idea...

If it looks like the drbd failover worked, that is, the /var/lib/nfs
symlink was pointed to drbd0, and drbd0 was there before nfs started.. it
may be something else that is causing stales during failover.

Personally, I moved from a live, non-drbd setup to a drbd setup, so I had
several non-friendly mount options on my nfs clients that caused the
failover to fail in such a way.

What are your nfs export and nfs client options, for mounting?  Double
check these, for sure...

> I've been reading the list-archives and googling around but haven't
> found anything that pointed me to where the problem lies.
> Is it not possible to use more than one volume for nfs-export?
> Thanks for any hints on this!
> Regards
>   Raoul

More information about the drbd-user mailing list