[CentOS] home on nfs

Sat Nov 4 15:49:58 UTC 2017
Pete Biggs <pete at biggs.org.uk>

> About NFS home directories and CentOS have you .nfsxxxxxxxxx tempory 
> files located in the home of your user ?
> I have this very often. I was not able to found any documentation about 
> this but if they are temporary files for NFS transactions is there a way 
> to store them on on local client disk area like /tmp instead of a NFS 
> storage?

It's not difficult to find out what the files are! They are a kludge on
the behalf of NFS to mimic the way a native filesystem doesn't free
blocks until all file handles are closed, even if the file is deleted.
So, if a file is deleted and there are still file handles that
reference it, the file is renamed to .nfsxxxxxxxx until the handle is
closed. (Even the NFS devs think it's a kludge - the feature is called
'silly rename' in the code. http://nfs.sourceforge.net/#faq_d2 )

They can't be anywhere else (like on /tmp) because they *are* on the
nfs filesystem.

> These files are some time difficult (if not impossible) to remove by the 
> user on the client side and stay on the disk... until I remove the 
> oldest ones on the server side.
If you remove one of the files on the client, and there is still an
open filehandle, the file is re-created with a different name, because,
well, there's still an open file handle associated with those blocks of

If you delete one of those files on the server side, and there are
still open handles on the client side associated with it then NFS
corruption and app crashing will ensue.

The way to deal with them is, primarily, make sure that your apps close
their file handles before removing a file.  If you want to find the app
that's responsible for them do 'lsof' on the file *on the client side*.
If the file doesn't have any open handles, then the client probably
crashed before removing them and they can be safely deleted.