3

I'm writing a Java program to go through and navigate into a ext2 filesystem image. I know my fs is revision 1 (or greater), so I know that there are copies of superblock in groups 0,1 and those that are powers of 3,5 and 7. My question is, what happens to the group descriptor when in a group without a superblock? is there any? if there is, does that mean that it's in the first block of the group? Where should I look for the inode table in my third group?

My fs has 3 groups (0,1,2), each 8192 blocks long with blocksize=1024.

4

1 回答 1

1

我发现了,所以我将把答案留在这里以供将来参考。

事实证明,组描述符块包含每个组的组描述符,一个接一个地添加。此外,组描述符的长度为 32 个字节(http://www.nongnu.org/ext2-doc/ext2.html#BLOCK-GROUP-DESCRIPTOR-TABLE)。所以如果你想要第n组的gd,你应该在Group Descriptor Block里面做n*32。

于 2014-12-01T22:20:27.140 回答