Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Oct 2003 02:30:18 -0700 (PDT)
From:      Pawel Malachowski <pawmal-posting@freebsd.lublin.pl>
To:        freebsd-i386@FreeBSD.org
Subject:   Re: i386/57480: Removing very large files using rm doesn't show the space being unallocated by the kernel and df.
Message-ID:  <200310030930.h939UIPp076198@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/57480; it has been noted by GNATS.

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ł Małachowski



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310030930.h939UIPp076198>