ext2 - group descriptor table of huge filesystems
Posted: Thu Sep 17, 2015 12:00 pm
Hello!
I have a couple of technical questions about ext2.
1. Suppose your filesystem has 1024 byte blocks, so 8192 blocks per group, and a group stores 8MB.
Now, a group descriptor table entry is 32 bytes long, so you can fit 32 of them in a block. So if your group descriptor table spans k blocks, you can have k*32 block groups total.
Now suppose your filesystem is 4TiB, the maximum of ext2 with 1024 byte blocks. You need 4TiB/8MB = 524.288 groups.
So, you need a group descriptor table that spans 524.288/32 = 16384 blocks. And a group only has 8192 blocks.
That seems plausible (albeit weird), but now what if the filesystem has a sparse supergroup? It would cause some problems, because for example, the group 1 has to have a backup of the superblock and the group descriptor table, but the group 1 is TOTALLY occupied by the group descriptor table of the group 0. What can I do in this border case?
2. What about online resizing of the group descriptor table (if there are no prealloced blocks for this purpose)? Is that possible?
Thank you in advance, if I did't make myself clear please ask for clarifications.
I have a couple of technical questions about ext2.
1. Suppose your filesystem has 1024 byte blocks, so 8192 blocks per group, and a group stores 8MB.
Now, a group descriptor table entry is 32 bytes long, so you can fit 32 of them in a block. So if your group descriptor table spans k blocks, you can have k*32 block groups total.
Now suppose your filesystem is 4TiB, the maximum of ext2 with 1024 byte blocks. You need 4TiB/8MB = 524.288 groups.
So, you need a group descriptor table that spans 524.288/32 = 16384 blocks. And a group only has 8192 blocks.
That seems plausible (albeit weird), but now what if the filesystem has a sparse supergroup? It would cause some problems, because for example, the group 1 has to have a backup of the superblock and the group descriptor table, but the group 1 is TOTALLY occupied by the group descriptor table of the group 0. What can I do in this border case?
2. What about online resizing of the group descriptor table (if there are no prealloced blocks for this purpose)? Is that possible?
Thank you in advance, if I did't make myself clear please ask for clarifications.