2007-01-31 13:33:17

by Trinabh Shukla

[permalink] [raw]
Subject: Move .nfsXXXX files

The .nfsXXXX file get created when I remove a file while it's being kept
open by one of the process. Due to this I can't remove directory which hold
this file. So I want to move this .nfsXXXX file on different temp directory
on the same nfs file system and delete that directory. Here it's working
properly.

But let me know that is it a correct solution? And removal of .nfs files
does not cause the server serious integrity.

Also it will be good, if you lead some pointers about how this .nfsXXXX
files handle by the NFS server.

Thanks,
-Trinabh


Attachments:
(No filename) (550.00 B)
(No filename) (594.00 B)
(No filename) (347.00 B)
(No filename) (140.00 B)
Download all attachments

2007-02-05 17:48:38

by Suresh Jayaraman

[permalink] [raw]
Subject: Re: Move .nfsXXXX files

>On January 31, 2007 at 7:03 PM, "Trinabh Shukla" <[email protected]> wrote:

> The .nfsXXXX file get created when I remove a file while it's being kept
> open by one of the process. Due to this I can't remove directory which hold
> this file. So I want to move this .nfsXXXX file on different temp directory
> on the same nfs file system and delete that directory. Here it's working
> properly.
>
> But let me know that is it a correct solution? And removal of .nfs files
> does not cause the server serious integrity.

If you're not bothered about the process which has that file open,
better kill the process. Moving to temp dir has problems as Trond
mentioned, even if sticky bit(chmod 777+t) is set for the temp dir.

> Also it will be good, if you lead some pointers about how this .nfsXXXX
> files handle by the NFS server.

As the server has no clue of file opens, it cannot implement "delete on
last close". Also, there is a possibility that client could crash or
neglect to remove the hidden files. So server may want to cleanup
these files periodically. Some servers (eg. Solaris servers) have a cron
script which searches exported filesystem for these files that
haven't not been accessed for a while and deletes them.

Thanks,
Suresh


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-02-01 03:42:53

by Trond Myklebust

[permalink] [raw]
Subject: Re: Move .nfsXXXX files

On Wed, 2007-01-31 at 19:03 +0530, Trinabh Shukla wrote:
> The .nfsXXXX file get created when I remove a file while it's being
> kept open by one of the process. Due to this I can't remove directory
> which hold this file. So I want to move this .nfsXXXX file on
> different temp directory on the same nfs file system and delete that
> directory. Here it's working properly.
>
> But let me know that is it a correct solution? And removal of .nfs
> files does not cause the server serious integrity.

The .nfsXXX file is a sign that some process still has that file open.
If you forcibly delete the file, you are very likely to screw up that
process. Better then just to kill the process.

You might be able to move the file to another directory, but the problem
then is that the process that tried to delete the file may not have
write access to that directory. In this case, the unlink may fail, and
you will be left with a dangling .nfsXXX file.

> Also it will be good, if you lead some pointers about how
> this .nfsXXXX files handle by the NFS server.

As far as the NFS server is concerned, this is a file just like any
other. The server attaches no special meaning to it.

Trond


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs