Archive for September, 2016

NFS misbehavior

Tuesday, September 27th, 2016

Today I had a peculiar problem with an NFS mount.

A linux client and a solaris client were connecting to the same NFS mount.

The solaris client was updating files properly, no sweat.

However, the linux client wasn’t syncing the changes.

I tried to remount the NFS mount on both clients to no avail.

Found some instructions about opening / closing the path itself to “flush” it, so I bojangled together this C program to handle it:

#include <fcntl.h>

int main()

int mypath;
mypath = open( “/put/your/path/to/flush/here/”, O_RDWR );
close( mypath );

I saved this as ‘nfs.flush.c’

You’ll need something like gcc to compile that (search for gcc package install instructions for your distribution, if necessary):

# gcc nfs.flush.c -o nfs.flush

You should see no errors. If errors appear, you’ll have to debug them yourself.

I ran this on the linux client system, no return results, and yet the NFS files were finally synchronized.

Hope this helps!