Bug 12527

Summary: Deleting a large file loses disk space
Product: Base System Reporter: kientzle
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.1-RELEASE   
Hardware: Any   
OS: Any   

Description kientzle 1999-07-06 01:50:00 UTC
I created a large file (approximately 3.6 gigabytes) on a UFS
partition.  After using 'rm' to remove the file, I noted
the following discrepancy:

df /usr showed 8 gigabytes of disk space used
du -x /usr shows only 4.5 gigabytes of disk space used

I expect some discrepancy between the two, but this seems a
bit excessive. ;-)

How-To-Repeat: Unfortunately, I no longer have enough free disk space
to check whether a large file built with 'dd' will
reproduce this problem.

I'm hoping that 'fsck' can correct it.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 1999-07-09 15:04:55 UTC
State Changed
From-To: open->feedback

From <Pine.NEB.3.95.971114152907.13922C-100000@praline.no.neosoft.com>: 

Some process has a file that has been rm'ed open, likely.  The file is  
not actually deleted until the last process that has it open closes it.  
Du will report the space as unused, df will report correctly. 

Are you sure this isn't the cause of your perceived problem? 
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 1999-07-19 10:01:18 UTC
State Changed
From-To: feedback->closed

Submitter agrees that the symptoms were caused by a process holding 
a deleted file open.