On Sep 28, 2015, at 01:07, gagan chhabra <gagan 13031990 gmail com> wrote:
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.