Removing ".nfs" files | Unix Linux Forums | Filesystems, Disks and Memory

  Go Back    


Filesystems, Disks and Memory Discuss NAS, SAN, RAID, Robotic Libraries, backup devices, RAM, DRAM, SCSI, IDE, EIDE topics here.

Removing ".nfs" files

Filesystems, Disks and Memory


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-14-2002
Jayathirtha Jayathirtha is offline
Registered User
 
Join Date: Aug 2001
Last Activity: 9 December 2003, 9:24 AM EST
Location: Bangalore
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Question Removing ".nfs" files

Hello,

I have a critical client-server application. I try to import a file from the local machine on to the server and open it (on the server). I can open it, but after this, when i try to open some other file on the server itself without saving this imported file, a .nfs file is being created.
This .nfs file will not be removed untill i close my application, but i am not supposed to close. Earlier i didn't have this problem. Now suddenly it started coming.

If anyone has come across anything like this, please help me in getting this sorted out.

I searched the web also, but nobody listed any solution nor the cause of this.

Thanks,
Jay.
Sponsored Links
    #2  
Old 04-15-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 18 September 2014, 4:49 AM EDT
Location: Ashburn, Virginia
Posts: 9,925
Thanks: 60
Thanked 434 Times in 259 Posts
In unix, it is ok to create a file, then unlink it, and continue to read and write to it. When you remove the last link to a file, it becomes a file with zero names. But the inode will not be freed until all processes close it. This is often done with temporary files. If the process aborts, the file will go with it.

It is hard to implement this in an nfs environment. If a nfs client gets a request from a local process to delete a file, it checks to see if any local processes still have that file open, if so, it renames the file to a .nfs<something> file. And after the last local process closes the file, the nfs client will actually issue the delete.

If you are running a process on a nfs client and that process attempts a unlink() system call on a open file, the above scenario plays out. But the process still has the file open. You should be glad that .nfs file is still around. You must be holding the file open in order to eventually do i/o to it. If this is not the case, the process has a bug. It should close the file if the file is no longer needed. If the process is going to run for days or weeks and it is opening files that it will never close, the file table will eventually fill.

The .nfs files should not really cause any trouble unless they are very large. Some people run a cron job on the nfs server that finds .nfs files that have not been accessed in the past two weeks and deletes them.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can I use "setfacl" to allow group to have "rwx" on a folder and its subfolders,files permanently? kchinnam UNIX for Advanced & Expert Users 5 03-20-2012 06:29 AM
awk command to replace ";" with "|" and ""|" at diferent places in line of file shis100 Shell Programming and Scripting 7 03-16-2011 08:59 AM
"Join" or "Merge" more than 2 files into single output based on common key (column) Katabatic Shell Programming and Scripting 1 05-20-2010 11:41 AM
Removing "Failed none for" error messages from sshd logs files Mr_Webster Solaris 3 04-21-2010 11:18 AM
Delete files older than "x" if directory size is greater than "y" JamesCarter Shell Programming and Scripting 4 02-11-2010 07:41 AM



All times are GMT -4. The time now is 11:41 AM.