From root@tsunami.misproductions.com  Wed Oct  1 14:29:49 2003
Return-Path: <root@tsunami.misproductions.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9CCFE16A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Oct 2003 14:29:49 -0700 (PDT)
Received: from tsunami.misproductions.com (c-24-127-5-95.we.client2.attbi.com [24.127.5.95])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C5C3F43FEC
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Oct 2003 14:29:48 -0700 (PDT)
	(envelope-from root@tsunami.misproductions.com)
Received: from tsunami.misproductions.com (localhost.misproductions.com [127.0.0.1])
	by tsunami.misproductions.com (8.12.9/8.12.7) with ESMTP id h91LTlh2047717
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 1 Oct 2003 14:29:48 -0700 (PDT)
	(envelope-from root@tsunami.misproductions.com)
Received: (from root@localhost)
	by tsunami.misproductions.com (8.12.9/8.12.7/Submit) id h91LTl0X047716;
	Wed, 1 Oct 2003 14:29:47 -0700 (PDT)
Message-Id: <200310012129.h91LTl0X047716@tsunami.misproductions.com>
Date: Wed, 1 Oct 2003 14:29:47 -0700 (PDT)
From: Shon Elliott <shon@misproductions.com>
Reply-To: Shon Elliott <shon@misproductions.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Removing very large files using rm doesn't show the space being unallocated by the kernel and df.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         57480
>Category:       i386
>Synopsis:       Removing very large files using rm doesn't show the space being unallocated by the kernel and df.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 01 14:40:09 PDT 2003
>Closed-Date:    Sun Sep 03 10:21:54 GMT 2006
>Last-Modified:  Sun Sep 03 10:21:54 GMT 2006
>Originator:     Shon Elliott
>Release:        FreeBSD 4.8-RELEASE-p4 i386
>Organization:
MiS Productions
>Environment:
System: FreeBSD tsunami.misproductions.com 4.8-RELEASE-p4 FreeBSD 4.8-RELEASE-p4 #23: Thu Sep 11 10:26:11 PDT 2003 root@tsunami.misproductions.com:/usr/obj/usr/src/sys/TSUNAMI i386


	AMD K6-2 400, FreeBSD 4.8-RELEASE-p4, 192M Memory, 17GB HD. SiS Based board.
>Description:
	When having a large file, sayt about 800 megs, and using rm on the file, it will be removed, however the space 
        occupied by that file will not be released by the kernel/filesystem  or shown by df. This has been noticed for UFS
        partitions, and not been extensively tested by me on any other filesystem.
>How-To-Repeat:
	Create a large file, say 800 megs. then remove said file using the rm command. 
>Fix:

	To work around the problem, you can use the following commands:
        echo "." > filename.ext 
        rm filename.ext

	That will cause the system to correctly report the freed space. If the UFS system using rm doesn't clear the space,
        the only way to recover that space seems to be a restart of the entire system.


>Release-Note:
>Audit-Trail:

From: Pawel Malachowski <pawmal-posting@freebsd.lublin.pl>
To: Shon Elliott <shon@misproductions.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: i386/57480: Removing very large files using rm doesn't show the space being unallocated by the kernel and df.
Date: Fri, 3 Oct 2003 11:30:49 +0200

 On Wed, Oct 01, 2003 at 02:29:47PM -0700, Shon Elliott wrote:
 
 > >Description:
 > 	When having a large file, sayt about 800 megs, and using rm on the file, it will be removed, however the space 
 >         occupied by that file will not be released by the kernel/filesystem  or shown by df. This has been noticed for UFS
 >         partitions, and not been extensively tested by me on any other filesystem.
 > >How-To-Repeat:
 > 	Create a large file, say 800 megs. then remove said file using the rm command. 
 > >Fix:
 > 
 > 	To work around the problem, you can use the following commands:
 >         echo "." > filename.ext 
 >         rm filename.ext
 > 
 > 	That will cause the system to correctly report the freed space. If the UFS system using rm doesn't clear the space,
 >         the only way to recover that space seems to be a restart of the entire system.
 
 For me, it works to use sync(8) few times to get df(1) and for example
 quota(1) output properly updated, or simply wait for a while.
 I use soft-updates.
 
 
 without soft-updates:
 # df -h /
 Filesystem    Size   Used  Avail Capacity  Mounted on
 /dev/da0s1a   2.9G   1.5G   1.1G    57%    /
 # dd if=/dev/zero of=dupa bs=1024 count=512000
 512000+0 records in
 512000+0 records out
 524288000 bytes transferred in 10.898418 secs (48106799 bytes/sec)
 # df -h /
 Filesystem    Size   Used  Avail Capacity  Mounted on
 /dev/da0s1a   2.9G   2.0G   664M    76%    /
 # rm dupa;df -h /
 Filesystem             Size   Used  Avail Capacity  Mounted on
 /dev/da0s1a            2.9G   1.5G   1.1G    57%    /
 
 
 with soft-updates:
 # df -h /home2
 Filesystem             Size   Used  Avail Capacity  Mounted on
 /dev/vinum/tiny-raid   992M    49K   913M     0%    /home2
 # dd if=/dev/zero of=/home2/dupa bs=1024 count=512000
 512000+0 records in
 512000+0 records out
 524288000 bytes transferred in 14.041056 secs (37339642 bytes/sec)
 # df -h /home2
 Filesystem             Size   Used  Avail Capacity  Mounted on
 /dev/vinum/tiny-raid   992M   500M   413M    55%    /home2
 # rm /home2/dupa;df -h /home2;sync;df -h /home2;sync;sync;sync;df -h /home2;sleep 2;df -h /home2
 Filesystem             Size   Used  Avail Capacity  Mounted on
 /dev/vinum/tiny-raid   992M   500M   413M    55%    /home2
 Filesystem             Size   Used  Avail Capacity  Mounted on
 /dev/vinum/tiny-raid   992M   500M   413M    55%    /home2
 Filesystem             Size   Used  Avail Capacity  Mounted on
 /dev/vinum/tiny-raid   992M   500M   413M    55%    /home2
 Filesystem             Size   Used  Avail Capacity  Mounted on
 /dev/vinum/tiny-raid   992M    49K   913M     0%    /home2
 
 
 -- 
 Pawe Maachowski

From: fox@vader.aacc.cc.md.us
To: freebsd-gnats-submit@FreeBSD.org, shon@misproductions.com
Cc:  
Subject: Re: i386/57480: freed space not showing at once in df
Date: 22 Oct 2003 20:09:14 -0000

 As someone else hinted, that's a bug^Wfeature^downside of soft updates.
 See for instance, tuning(7). (Not sure reading the initial PR that the
 sender has softupdate active on that filesystem, but if it is, that's
 likely to be the reason.)
 
State-Changed-From-To: open->patched 
State-Changed-By: kris 
State-Changed-When: Fri Oct 31 18:12:48 PST 2003 
State-Changed-Why:  
Fixed in 5.x, but not yet merged to 4.x. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57480 
State-Changed-From-To: patched->closed 
State-Changed-By: remko 
State-Changed-When: Sun Sep 3 10:18:40 UTC 2006 
State-Changed-Why:  
All revisions had been updated to RELENG_4, close the PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57480 
>Unformatted:
