How to Get the Offset in a Block Device of an Inode in a Deleted Partition

EXT2: Understanding inode bitmaps

The first three inodes are marked as used. Your problem is you are reading the bits from left to right, whereas the lowest bit, i.e. the one on the right, shows you the state of the first inode, so you should be reading the bits from right to left.

Find the superblock on disk

You can grep the output of dumpe2fs device_name for existance of "superblock at".

Here's an example on my Centos 5 linux system:

>>> import shlex, subprocess
>>> filesystems = ['/dev/mapper/VolGroup00-LogVol00', '/dev/vda1', 'tmpfs']
>>> for fs in filesystems:
... command = '/sbin/dumpe2fs ' + fs
... p = subprocess.Popen(shlex.split(command),stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
... output = p.communicate()[0]
... if 'superblock at' in output:
... print "{fs} has superblock".format(fs=fs)
... else:
... print "No superblock found for {fs}".format(fs=fs)
...
/dev/mapper/VolGroup00-LogVol00 has superblock
/dev/vda1 has superblock
No superblock found for tmpfs

More information on dumpe2fs:

http://linux.die.net/man/8/dumpe2fs

I have ext2 formatted file system Images. I like to read in terminal all the file system structures data in Linux specifically Ubuntu.Is there a tool

I'm not certain I understood your question, but I think you probably just want to "loopback mount" your filesystem in a file. See here.

Failing that, I think you can use e2tools to access the contents. See here.

How to read an inode table from an ext2 block group?

The block IDs in the block group descriptor table are all absolute, so block ID 64 is going to be stored at LBA 128 and 129 in your case.



Related Topics



Leave a reply



Submit