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.