Re: Shrinking ext3 directories

Stephen C. Tweedie
2002-06-18T21:50:07Z

Hi,

On Tue, Jun 18, 2002 at 06:08:28PM +0200, DervishD wrote:

> All of you know that if you create a lot of files or directories
> within a directory on ext2/3 and after that you remove them, the
> blocks aren't freed (this is the reason behind the lost+found block
> preallocation). If you want to 'shrink' the directory now that it
> doesn't contain a lot of leafs, the only solution I know is creating
> a new directory, move the remaining leafs to it, remove the
> 'big-unshrinken' directory and after that renaming the new directory

Right. Shrinking directories is not implemented for ext2 or ext3 at
the moment. However, I know that Daniel Phillips has been thinking
about adding that for his HTree extensions which add fast directory
indexing to ext2/3.

Cheers,
Stephen