can ext3 directory entries be overwritten? -- Re: extremely slow "ls" on a cleared fatty ext3 directory on FC4/5
Theodore Tso
tytso at mit.edu
Sun Aug 13 20:47:10 UTC 2006
On Sun, Aug 13, 2006 at 11:57:41AM -0700, Robinson Tiemuqinke wrote:
> Hi, all,
>
> I'm a newbie to ext3 file system, but what a pity if
> ext3 could not shrink after containing files and
> subdirectories get deleted.
>
> If the ext3 directory could not shrink, then another
> natural question is: can the deleted directory entries
> be overwritten by new files/subdirs? The following is
> an example to detail my question:
Yes, of course. If a directory contains deleted directory entries,
they do o fcourse get reused. So in the case where the number of
files remains more or less at a steady state, ext3 will do fine. What
ext3 does not currently handle is the case where someone creates 131
megabytes worth of directories (which is enough for 4-8 million
files!), and then deletes them all. The directory will not shrink
back down to its original size.
Likewise, most modern filesystems implement on-line resizing, where
the total size of the filesystem can be extended if you are using an
LVM and/or RAID system, and can expand the underlying
volume/partition. However, no filesystems that I know of implement an
on-link shrink operation. Some have an off-line shrink operations;
some don't even have that.
- Ted
More information about the Ext3-users
mailing list