From gagan.13031990 at gmail.com Mon Sep 28 07:07:37 2015 From: gagan.13031990 at gmail.com (gagan chhabra) Date: Mon, 28 Sep 2015 12:37:37 +0530 Subject: parse raw image to read block group desc table! Message-ID: 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. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From adilger at dilger.ca Mon Sep 28 19:55:11 2015 From: adilger at dilger.ca (Andreas Dilger) Date: Mon, 28 Sep 2015 13:55:11 -0600 Subject: parse raw image to read block group desc table! In-Reply-To: References: Message-ID: <8E3C2A0D-ABF0-48DC-94AE-80249007FFC0@dilger.ca> On Sep 28, 2015, at 01:07, gagan chhabra 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 redhat.com > https://www.redhat.com/mailman/listinfo/ext3-users -------------- next part -------------- An HTML attachment was scrubbed... URL: