2

I have a block device that contains some valid filesystem (including the main and backup superblocks) at some unknown offset with some unknown block size. In my case I happen to know that it's an ext4 filesystem with 4KiB blocks, but I'm hoping for a solution that will work for any OS-supported filesystem. What is the most efficient way to find its offset?

My current plan is to run fsck on every single byte-offset until it returns successfully. Obviously this is resource-intensive and slow, but I have yet to find or come up with a better tool or method to accomplish this.

1 Answer 1

0

It should be possible to use gpart for this. It is supposed to find partitions and maybe you never had one but the approach is the same. You can have it restore a partition which never existed. That will give you the position of the filesystem. After that you can delete the partition table.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .