rm'ing an open file (was Re: Where has all my disk space gone?)
Ken Weaverling
weave at brahms.udel.edu
Wed Apr 24 10:29:36 AEST 1991
In article <1991Apr23.174228.11278 at aucs.AcadiaU.ca> in comp.unix.questions
peter at aucs.acadiau.ca (Peter Steele) originally writes:
>df reports the following:
>
>/dev/dsk/ipc1d2s3 ffs 945670 589136 356534 62% /u2
>
>According to this, we have 589136 kbytes in use on this drive. However,
>du does not seem to agree with df:
>994268 /u2
>
>The total of 994268 blocks in use converts to 497134 kbytes, a difference
>of 92002 kbytes--not a small amount.
Gee, looks like you need Norton Utils for Unix! :-)
I have had something similar happen. I had 10% of disk in use then suddenly
the console was screaming the disk was full. Never knew why. I shut the
partition down and ran fsck and it recovered the missing space...
Must have been a PC virus... :-) <<<==< READ: *BIG* TIME sarcasm!
But the reply below is my real reason for replying....
In article <1991Apr23.194511.29646 at Think.COM>
barmar at think.com (Barry Margolin) replies:
>If a process opens a file and then deletes it, the file still exists on
>disk until all the processes that have it open either close it or die.
God, this took a while for me to get used to.
process phredd opens file foo
process phredd puts a write lock on file foo
process phredd reads data from foo
process phrogg removes file foo -- even though file is opened and locked
ls doesn't see foo in directory
process phrogg recreates file foo
process phrogg writes data to file foo
process phredd rewinds file foo
process phredd re-reads data and gets original data from "non-existant" file!
It makes you have to do ugly things like make LOCK files and have all
processes look for them. Gack....
(followups to comp.unix.programmer)
--
>>>---> Ken Weaverling >>>----> weave at brahms.udel.edu
More information about the Comp.unix.questions
mailing list