Re: ext2fs: do directories ever shrink?

Nathan Hand (nathanh@chirp.com.au)
Wed, 15 Jul 1998 22:30:08 +1000 (EST)


On Tue, 14 Jul 1998, Clifford Wolf wrote:

> On does not need to modify fsck to "shrink" directories at boot time -
> this shell script should do the job (i've not tested it now and it's not
> perfect - but it shows the basic idea):
>
> find / -type d -fstype ext2 |
> while read dirname
> do
> mkdir $dirname.new_version
> mv $dirname/* $dirname.new_version/
> rmdir $dirname
> mv $dirname.new_version $dirname
> done
>
> One of the problems with this script is that it does not preserve the
> permissions of the directories. The fact that it creates new directories
> with new inode numbers shouldn't be a problem since it is started at boot
> time.
>
> It is easier to preserve the permissions useing a little C-Programm.

It also doesn't preserve [amc]-time, and this is unacceptable.

Fixing ext2 is the best solution, though shrinking active directories
is a non trivial thing to do.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html