Recovering data from a single-disk raid1 array [closed]

Solution 1:

Since the RAID superblock was created at the beginning of the disk initially, the real data begins afterwards.

Usually, that is what you want, because it ensures that any access to the disk goes through the RAID, and the set remains consistent, but it also means that block 0 of the RAID is not block 0 of the disk.

So this means that the data needs to be shifted. This can be done in-place with dd since you are moving blocks from the back to the front, but if that process is interrupted, you are likely to lose data, and it is kind of irreversible since dd cannot work in reverse order, which you'd need to move blocks towards the end of the disk.

At this point I'd ask myself if the effort is worth it. The overhead of a one-disk RAID1 is the kernel adding an offset to every request, in a well-optimized code path. The easy way out for you is to just recreate the RAID with the --assume-clean option.