http://weichong78.blogspot.com/2007/04/ext2-block-group.html Ext2 filesystem divides a partition into block groups. This can be seen using the dumpe2fs utility. How many block group can there be in a filesystem/partition? That depends on the block size and the partition size. In each of the block group, the kernel keep track of the free and used blocks using a bitmap. Each bit in that map represents the free/used state of a corresponding block in the partition. The only constraint is that the bitmap itself must occupy at most one block. Therefore it can map at most (8 x block_size_in_octet) blocks. The block size is determined by the system administrator who created the partition, using the mke2fs utility. So, for example if the partition has a block size of 4k, then the bitmap can at most represent (8 x 4096 = 32768) blocks, which can be verified using dumpe2fs (you will see that it reports Group 0 block range is 0 to 32767, in this case). So, that means a group can only have 32768 blocks in this case. So, in a partition of say 12GB or (12 x 1024 x 1024 x 1024 = 12884901888) bytes/octets partition, with 4k or 4096 octets as block size, we will have (12884901888/4096 = 3145728) blocks. Therefore, we will have (3145728/32768 = 96) block groups in that partition, which of course is what dumpe2fs will give you, in this case. Labels: ext2 filesystem |