parse raw image to read block group desc table!

Andreas Dilger adilger at
Mon Sep 28 19:55:11 UTC 2015

On Sep 28, 2015, at 01:07, gagan chhabra <gagan.13031990 at> wrote:
> Hi,
> I am writing a piece of code to open a raw image file of a virtual machine which has ubuntu installed in it. The virtual disk is formatted using MBR partitioning method and has 3 primary and 1 extended partition.
> I want to open up that file and read the block group descriptor table and inode table for each partition. I have written some lines of code and successfully able to read the partition entries and the superblock of each partition.

First question is why you are writing your own code to do this? Much
better would be to attach a loop device to the image file to handle
the partition table offset, then use libext2fs to open and access the
filesystem any way you want.

I don't think it is possible to directly access a filesystem within an image
directly, but if that is a requirement and loop devices cannot be used,
then this would be WAY easier to fix in libext2fs compared to rewriting
the full ext3/4 access yourself. 

That ensures it will be able to handle the myriad of different ext3/4
options and combinations thereof, both now and in the future. 

Cheers, Andreas

> But now I am stuck and unable to read  block group descriptor table and inode table. Shall I post my code here? Any suggestion or resource would be of great help.
> Thanks,
> Gagan
> Mob: +91 97049 28427
> _______________________________________________
> Ext3-users mailing list
> Ext3-users at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Ext3-users mailing list