Re: [osol-discuss] Seeing .nfs0000000000002def00000002 on nfs mounts from linux

2010-04-22 Thread Richard L. Hamilton
In Unix (or even Linux:-), it's perfectly legal to delete a file while it's 
open.
If that's the last link to the file, it will go away once the last program that
has it open exits.

Problem is, NFS is stateless - the NFS server isn't keeping track of what
the clients are doing.  So NFS can't truly handle that particular Unix
behavior.  The clients work around the problem by renaming the file like that
and deferring the delete until nothing on the client has it open.

There are only two problems with that:
1) it's not totally invisible, so people ask questions about it
2) if the client crashes while deleted files are open, those .nfs* files
never get deleted.

To deal with (2), many NFS servers have a cron job that hunts down
files named .nfs* that haven't been accessed in more than a certain
number of days, and deletes them.  That isn't perfect, because if
a client program was still running but went too long (say more than
a week) between accesses to that file, the server would assume the
file had been abandoned and would delete it.  In practice, that
apparently is not a problem very often.

So you can either:
* ignore the problem, it'll probably go away eventually
* use lsof or something like it on the client to figure out what program
has the files open, and kill it (only do this if those files are huge and
you're running out of space)

Technically you could also log into the server and delete the files there,
but then the client would start getting stale NFS file handle errors or
something like that, because it was expecting that file to still be there.

Usually the best bet is to just ignore files like that...
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Seeing .nfs0000000000002def00000002 on nfs mounts from linux

2010-04-22 Thread Casper . Dik

Using an Osol b 133 nfs server.  When working from a linux client I
sometimes see files like: .nfs2def0002 
  .nfs2f6b0001

Appear on the filesystem as I'm working... any attempt to remove them
(from the linux client) fails, with the message:

   (file-error Removing old name Device or resource busy
   /projects/reader/perl/mapping/.nfs2f6b0001)

What are these?


When a file is unlinked by an NFS client but the file is still open,
the client actually renames the file and later removes it after the file 
is closed.  (It is created by the client and it shoul be removed by the 
client; the client makes sure you don't remove it)

Casper

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Seeing .nfs0000000000002def00000002 on nfs mounts from linux

2010-04-22 Thread Harry Putnam

Haaa lots of nice input there... thanks folks

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Seeing .nfs0000000000002def00000002 on nfs mounts from linux

2010-04-21 Thread Giovanni Tirloni
On Wed, Apr 21, 2010 at 9:50 PM, Harry Putnam rea...@newsguy.com wrote:

 Using an Osol b 133 nfs server.  When working from a linux client I
 sometimes see files like: .nfs2def0002
  .nfs2f6b0001

 Appear on the filesystem as I'm working... any attempt to remove them
 (from the linux client) fails, with the message:

   (file-error Removing old name Device or resource busy
   /projects/reader/perl/mapping/.nfs2f6b0001)

 What are these?


Probably deleted files being held by a process. You can try to find it with
lsof and kill that process if you wish.

-- 
Giovanni
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org