Re: resize directory index/journal



On 28 Dec 2006 09:20:51 -0800, Ben
<jbenjam@xxxxxxxxx> wrote:


Hi,

Fedora Core 5, ext3 filesystem:

I have a directory that contained thousands of files, as a result, the
directory file has a large "size", which presumably is due to some kind
of indexing. However, once the thousands of files are removed, it
still maintains this large size. For example, the first directory
listed below (DWR/) contained the thousands of files, and the following
one (DWR2) only contained a hundred or so:

22852 drwxrwxr-x 16 jbenjam jbenjam 23367680 Dec 28 21:07 DWR/
40 drwxrwxr-x 5 jbenjam jbenjam 40960 Dec 28 21:34 DWR2/

The result of this is that even though most of the files in DWR/ are
now gone, the size remains the same. When I try to get a listing, it
requires significant disk activity to list the few files that remain.
I'm assuming that is because it has to read through some kind of
journal or internal index having 23367680 bytes, rather than the 40960
byte index in DWR2/.

Is there any way to "shrink" the index to a size that's appropriate for
the current number of files?
The obvious way would be to create a new directory, copy the contents of
DWR, remove the old DWR and rename or symlink the new directory to DWR.


Alternatively, Is there a linux
filesystem that handles large numbers of files better than ext3?

Thanks and happy holidays,

-Ben



--
Shannon's Observation:
Nothing is so frustrating as a bad situation that is beginning to
improve.
.



Relevant Pages