Help Center/ Scalable File Service/ FAQs/ Others/ How Do I Delete .nfs Files?
Updated on 2024-06-27 GMT+08:00

How Do I Delete .nfs Files?

NFS .nfs Files

The .nfs files are temporary files in NFS. If you try to delete a file, and the file is still open, a .nfs file will appear. The .nfs files are used by NFS clients to manage the deletion of open files in the file system. If one process deletes a file while another process still has it open, the client will rename the file to .nfsxxx. If the last open to this file is closed, the client will automatically delete the file. If the client crashes before the file is cleared, the file will be left in the file system.

Clearing .nfs Files

The .nfs files need to be cleared. You can run the rm -f command to delete them. The file system will not be affected by the deletion. If an error is reported when you delete a .nfs file, do as follows:

Figure 1 Deletion error

Run the lsof command to obtain the ID of the process that has the file open.

Figure 2 Viewing the process ID

If the process can be stopped, run the kill -9 Process ID command to stop the process and then delete the file.