What are EFS files starting with .nfs?


I'm trying to debug a file-based PHP CMS that is continuously trying to write a file, but failing. I saw the following:

-rw-r--r-- 1 webapp webapp  87717 Aug  2 09:01 response.cache
-rw-r--r-- 1 webapp webapp 167700 Aug  2 09:57 .nfs3bb62bc5d551a49f0000000c

There's the old file response.cache and a file starting with ".nfs" that contains updated content. My guess is that EFS is in the process of writing the file while other instances of the PHP script try to read/write it. In any case, it appears to be a part of the issue.

What is that file?

asked a year ago457 views
1 Answer
Accepted Answer

Hi dodov,

In Linux running over NFS, .nfs files are created when a file opened on a client is deleted from the file system while still opened. The client renames the file to a fairly long string like you're seeing in order to discourage other clients or processes from using the file.

Usually you can find out what process is causing using the lsof command, in this case:

lsof .nfs3bb62bc5d551a49f0000000c

This will output the process that is working with the file, and if necessary, you can then kill said process.

profile pictureAWS
answered a year ago
  • So this is a Linux feature, rather than an EFS feature? What doesn't make sense to me is that in my case, files were never deleted (to my knowledge, at least). They were only read and written rapidly. Is there another reason why .nfs files could appear? Do you know of any documentation on the matter?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions