After I played with mdadm a bit too hard, I'm now tryng to recover my lvm2 volumes that were sitting in the original RAID1 array. pvscan finds nothing, but that's not a surprise: since mdadm is not able to rebuild the array, pvscan has no /dev/md1 to look at.
However I know (er... I hope) my lvm2 volumes are still there, I think I only zapped the raid metadata.
My idea is to losetup /dev/sdc2 under /dev/loop1 with an offset using a live sysresccd, so that I skip the broken RAID metadata in /dev/sdc2 and reach the PV itself. I plan something like:
losetup -o xxxxxx /dev/loop1 /dev/sdc2
pvscan
Then pvscan can find the volume in /dev/loop1. The problem is that I don't know the offset (but that can be overcome by studying or by trial and error) and, most importantly, that losetup does not work with physical devices. How can I create a device that points to another device with an offset? Or, how can I make pvscan look for physical volumes using an offset?
EDIT after @lsd comment:
When I tried:
losetup -o 32256 /dev/loop1 /dev/sdc2
I got:
losetup: /dev/sdc2: warning: file smaller than 512 bytes, the loop device maybe be useless or invisible for system tools.
and I assumed the warning was telling me something was wrong, because /dev/sdc2 is smaller than 512 bytes only if you consider it as a normal file, but if losetup supported block devices it should know its real size... should I ignore the warning nevertheless?