What are EFS files starting with .nfs?

0

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?

dodov
已提问 2 年前669 查看次数
1 回答
1
已接受的回答

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
已回答 2 年前
  • 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?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则