Strange Unix file system object (Re: Missing space in root)

Dan Bernstein bernsten at phoenix.Princeton.EDU
Mon Apr 17 14:01:50 AEST 1989


In article <10016 at orstcs.CS.ORST.EDU> pvo1478 at oce.orst.edu (Paul O'Neill) writes:
  [Starts Mail on a 1.6 MB mailbox]
  [df suddenly shows 1.6 MB less space in a file system]
  [there's no file system entry for a 1.6 MB file]
> ``ofiles'' (thank god for ofiles) shows Mail has an open inode, 1788, 
> on the root file system.  But "find / -inum 1788 -xdev -print" shows
> nothing.
> 
> So, what is this bizarre object?  Ofiles and df know about it.
> du, ls, and find don't know about it.

The kernel won't free the filesystem space for a file until (1) it has
zero hard links and (2) it is accessed by zero processes. It wouldn't
be a good idea to delete an opened file just because its last directory
entry disappears: what information do you give to the process reading
the file? So the kernel quite naturally waits until Mail closes the file
before deleting it.

Probably your Mail program removes the old file after it's opened it;
then it makes a new mailbox file. I'd advise using a mail reader with
a more conservative approach to file handling.

---Dan Bernstein, bernsten at phoenix.princeton.edu



More information about the Comp.unix.questions mailing list