Discussion:
.nfs files: Safe to delete or not?
(too old to reply)
Rahul
2009-09-29 00:09:16 UTC
Permalink
Sometimes my directories have a bunch of .nfs* files named like so:

.nfs0000000009280040000000b8

Is it safe to delete .nfs files? Or are they required for some operation?

Should I be changing something in my nfs settings or have a cron job that
just deletes old .nfs files?
--
Rahul
Casper H.S. Dik
2009-09-29 07:58:38 UTC
Permalink
Post by Rahul
.nfs0000000009280040000000b8
Is it safe to delete .nfs files? Or are they required for some operation?
Should I be changing something in my nfs settings or have a cron job that
just deletes old .nfs files?
These files are an artifact of the NFS client implementation; the
client deletes a file while the same client has the file open.

If the file is closed, the client will remove the file. However,
if the client crashes or reboots it may not have removed the file.

Removing a .nfs* file may cause a "stale file handle" in the client.

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
Rahul
2009-09-29 08:09:50 UTC
Permalink
Post by Casper H.S. Dik
These files are an artifact of the NFS client implementation; the
client deletes a file while the same client has the file open.
If the file is closed, the client will remove the file. However,
if the client crashes or reboots it may not have removed the file.
Removing a .nfs* file may cause a "stale file handle" in the client.
So what's the best way out? What's the practical way out. How do other
sys-admins with NFS handle this issue?
--
Rahul
Casper H.S. Dik
2009-09-29 09:15:42 UTC
Permalink
Post by Rahul
Post by Casper H.S. Dik
These files are an artifact of the NFS client implementation; the
client deletes a file while the same client has the file open.
If the file is closed, the client will remove the file. However,
if the client crashes or reboots it may not have removed the file.
Removing a .nfs* file may cause a "stale file handle" in the client.
So what's the best way out? What's the practical way out. How do other
sys-admins with NFS handle this issue?
In Solaris, the default root's contrab runs the command "nfsfind" which
removes all .nfs files on exported filesystems if it is not modified
the last week. That's one solution, but running it every week or every
day may take a long time on larger file servers.

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
Rahul
2009-09-29 15:48:20 UTC
Permalink
Post by Casper H.S. Dik
In Solaris, the default root's contrab runs the command "nfsfind" which
removes all .nfs files on exported filesystems if it is not modified
the last week. That's one solution, but running it every week or every
day may take a long time on larger file servers.
Thanks! I'll make a similar script on my Linux server. We have
approximately 500 GB files.
--
Rahul
Continue reading on narkive:
Loading...