linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ext3: deleting files doesn't free up space
@ 2011-01-10  5:22 Dan Carpenter
  2011-01-10  6:07 ` Nick Dokos
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2011-01-10  5:22 UTC (permalink / raw)
  To: LKML, linux-ext4

I filled up my partition last night.
I deleted 5 gigs of movies.
The "Used" number went down to 125G.
The "Free" number stayed at 0.
I rebooted the system but it's still the same.

$ echo foo > foo
bash: echo: write error: No space left on device

$ df .
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1            136236548 130363620         0 100% /media/old_sys

$ mount | grep old
/dev/sda1 on /media/old_sys type ext3 (rw,nosuid,nodev)
/media/old_sys/home on /home type none (rw,bind)

This is with 2.6.37-rc5+.  Is there a way to debug this?

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ext3: deleting files doesn't free up space
  2011-01-10  5:22 ext3: deleting files doesn't free up space Dan Carpenter
@ 2011-01-10  6:07 ` Nick Dokos
  2011-01-10  6:10 ` Daniel K.
  2011-01-10  7:48 ` Rogier Wolff
  2 siblings, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2011-01-10  6:07 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: LKML, linux-ext4, nicholas.dokos

> I filled up my partition last night.
> I deleted 5 gigs of movies.
> The "Used" number went down to 125G.
> The "Free" number stayed at 0.
> I rebooted the system but it's still the same.
> 
> $ echo foo > foo
> bash: echo: write error: No space left on device
> 
> $ df .
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/sda1            136236548 130363620         0 100% /media/old_sys
> 
> $ mount | grep old
> /dev/sda1 on /media/old_sys type ext3 (rw,nosuid,nodev)
> /media/old_sys/home on /home type none (rw,bind)
> 
> This is with 2.6.37-rc5+.  Is there a way to debug this?
> 

I don't think there is anything to debug. ext3 reserves by default 5% of
the space for root's use. You will see "Available" go positive when
"Used" is reduced to below 0.95*136236548 blocks = 129424720 blocks
roughly.  You can check your numbers by running

    dumpe2fs -h /dev/sda1

and checking the "Block count" and "Reserved block count" fields.

You should be able to write to the filesystem as root though, as long
as Used < Total number of blocks. And you can adjust the reserved space
with ``tune2fs -m <N>''.

See e.g https://wiki.archlinux.org/index.php/Ext3_Filesystem_Tips
(the first hit from a Google search for "ext3 reserved").

Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ext3: deleting files doesn't free up space
  2011-01-10  5:22 ext3: deleting files doesn't free up space Dan Carpenter
  2011-01-10  6:07 ` Nick Dokos
@ 2011-01-10  6:10 ` Daniel K.
  2011-01-10  7:48 ` Rogier Wolff
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel K. @ 2011-01-10  6:10 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: LKML, linux-ext4

Dan Carpenter wrote:
> I filled up my partition last night.
> I deleted 5 gigs of movies.
> The "Used" number went down to 125G.
> The "Free" number stayed at 0.
> I rebooted the system but it's still the same.
> 
> $ echo foo > foo
> bash: echo: write error: No space left on device
> 
> $ df .
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/sda1            136236548 130363620         0 100% /media/old_sys

Check out the -m option to tune2fs, which sets the reserved-blocks-percentage for the FS - the percentage of blocks reserved to the super user, which is 5% by default.

Presumably, root has filled the partition completely, and 5G worth of deleted user data is not enough to get under the 5% limit to allow for new data to be written by users.

As this partition is used for /home you might as well turn the feature off, as root should not need to have space reserved in that area of the filesystem.

	tune2fs -m 0 /dev/sda1

should give regular users access to the reserved blocks.


Daniel K.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ext3: deleting files doesn't free up space
  2011-01-10  5:22 ext3: deleting files doesn't free up space Dan Carpenter
  2011-01-10  6:07 ` Nick Dokos
  2011-01-10  6:10 ` Daniel K.
@ 2011-01-10  7:48 ` Rogier Wolff
  2 siblings, 0 replies; 4+ messages in thread
From: Rogier Wolff @ 2011-01-10  7:48 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: LKML, linux-ext4

On Mon, Jan 10, 2011 at 08:22:25AM +0300, Dan Carpenter wrote:
> I filled up my partition last night.
> I deleted 5 gigs of movies.
> The "Used" number went down to 125G.
> The "Free" number stayed at 0.
> I rebooted the system but it's still the same.

Hi Dan, 

The system keeps at least 5 or 10% of the total space free so that it
will always be able to find a reasonably unfragmented spot for a new
big file. That same 5 or 10% CAN be written by the root-user in
emergencies. But "root" should know it can affect the peformance of
his filesystem. Anyway, because you're still using part of the 5 - 10%
reserved-for-performance reasons, "df" will report the user-available
space as zero. 

	Roger. 

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
**    Delftechpark 26 2628 XH  Delft, The Netherlands. KVK: 27239233    **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement. 
Does it sit on the couch all day? Is it unemployed? Please be specific! 
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-10  7:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-10  5:22 ext3: deleting files doesn't free up space Dan Carpenter
2011-01-10  6:07 ` Nick Dokos
2011-01-10  6:10 ` Daniel K.
2011-01-10  7:48 ` Rogier Wolff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).