Re: Ext2 defragmentation

Theodore Y. Ts'o (tytso@mit.edu)
Wed, 17 Nov 1999 11:51:13 -0500


From: danielt@digi.com
Date: Wed, 17 Nov 1999 10:03:36 -0600 (CST)

The superblock at the first 32M should always be there.
It would be the first backup with 4k blocks and the
fourth with 1k blocks (or the second with 2k blocks?).

No, it's not that simple. The superblock is located at:

superblock_offset = superblock_n * block_size

where

superblock = 1 + (blocks_per_group * n)
blocks_per_group = block_size * 8

Using 4k blocks, the first superblock is located at 32769 * 4k, or an
offset of 131076k. Using 1k blocks, the sixteenth (not 4th!)
superblock is located at (8192*16 + 1) * 1k, for an offset of 131073k.

So yes, there is a superblock somewhere around 128 Meg which is the
first superblock on a 4k filesystem and the 16th superblock on a 1k
system, but it's not quite in the same place.

- 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/