[ILUG] HOWTO recover a borked 3ware RAID-1 array (long)

Ronan Cunniffe ronan at iaa.es
Thu Nov 2 12:58:36 GMT 2006


Hi all,
    3ware 7000 & 8000 series RAID controllers have a nasty habit of 
corrupting their proprietary bits and saying "disk incomplete" if 
they're shut down at the wrong moment.  I've just finished sorting one 
out (*cough* _permanently_), and maybe this howdunnit might be useful.

Step 1) Find the real disk layout.
    The 3ware sticks its proprietary bit at the start of the disk.  
Where does the "real" data start?  In my case, the proprietary stuff 
took up 1024 sectors.  I know this because:

       for i in `seq 1 2048`; do dd if=/dev/hda of=diskblock.$i bs=512 
skip=$i count=1; done
       file diskblock.* | grep boot

gave me:

       diskblock.1024: x86 boot sector

Step 2) Find the partition table
    I tried:
         losetup /dev/loop0 /dev/hda -o 524288
         fdisk -l /dev/loop0

    and was rewarded with the truly weird, but accurate:

    Disk /dev/loop0: 80.0 GB, 80007761920 bytes
    255 heads, 63 sectors/track, 9728 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
    /dev/loop0p1              1          129     1031610  82  Linux swap
    /dev/loop0p2   *        130        429    77......   83  Linux


Step 3) Mounting the partition - the off-by-one error
    Note that tracks are numbered from 1, not 0, so the start of track 
130 is at 16065*512*129.

    so:
        losetup /dev/loop0 /dev/hda -o $((524288+(129*512*16065)))

    If you want to double check with dd(1) and file(1) as before, 
looking for confirmation you have an ext2 fs starting here, 'dd bs=512 
count=1' won't work, because the signature of an ext2 fs is (according 
to /usr/share/file/magic (on Debian)) 1080 bytes in.... 

Step 4: subject the 3ware to some torsion testing and use the onboard 
IDE and the md driver instead.

Regards,

Ronan



More information about the ILUG mailing list