Set device offset in Linux due to failed hardware RAID?
I have a failed hardware RAID card. This card had two drives in a RAID-1 mirror. Plugging one of the drives into the motherboard shows no partition table. Using a program like testdisk, I can see the partition table starts 32 blocks into the drive. Apparently the hardware RAID card uses the first 32 blocks for storing its config.
I can display the starting offset of a drive like so:
root@nas1:~# hdparm -g /dev/sdc
/dev/sdc:
geometry = 974/255/63, sectors = 15649200, start = 0
...but I can't seem to find a way to tell it to start at 63 blocks instead of 0. If the OS starts reading at 63, it will see the partition table.
Is that even possible under Linux?
Solution 1:
You can use losetup for accessing the filesytems, using --offset and --sizelimit (optional) parameters. Just remember that you have to give it bytes. That means offset = 512 * sector.
Another idea is to copy the partition table to sector 0, but you will probably need to adjust the sector numbers.