Ext2: Group Descriptors

1.3k views Asked by At

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.

1

There are 1 answers

0
jrsall92 On BEST ANSWER

I found out so I'll just leave the answer here for future references.

As it turns out, the Group Descriptor block contains group descriptors for each group, added one after another. Also a group descriptor has 32 bytes length (http://www.nongnu.org/ext2-doc/ext2.html#BLOCK-GROUP-DESCRIPTOR-TABLE). So if you want the gd of the n-th group, you should do n*32 inside the Group Descriptor Block.