Re: Ext2 defragmentation

Theodore Y. Ts'o (tytso@mit.edu)
Sat, 13 Nov 1999 15:41:53 -0500


Date: Sat, 13 Nov 1999 21:35:10 +0100 (CET)
From: arjan@fenrus.demon.nl (Arjan van de Ven)

> 8 meg block groups imply you're using 1k blocks. 32 meg block groups
> imply you're using 4k blocks. E2fsprogs 1.18 automatically creates
> filesystems with 4k blocks when making large filesystems, but most folks

Is it capable of changing an existing fs from 1k to 4k? Or do I have to
re-mke2fs

No, there's no way to change an existing filesystem's block size. You
have to backup the filesystem, and run mke2fs, and then restore the
filesystem. Note that there are some efficiencies with using 4k blocks;
it means that each file will always be a multiple of 4k, rounding up
from the actual size. So even if a file takes up 2000 characters, it
will still take 4096 bytes from the disk. But on larger disks, the
slight storage inefficiency is well worth the tradeoff in performance.

Also, note that I made a mistake in the above quoted message; Ext2
filesystems with 4k block sizes have 32768 blocks per block group, which
means there are 128 megs in a block group. My apologies for any
confusion I may have caused.

- Ted

-
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.tux.org/lkml/