Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Recovering Highpoint ATA-RAID0 after killing it with GRUB
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Tux's lil' helper
Tux's lil' helper

Joined: 31 Jul 2003
Posts: 136
Location: Germany

PostPosted: Thu Sep 25, 2003 2:43 pm    Post subject: Recovering Highpoint ATA-RAID0 after killing it with GRUB Reply with quote

Recovering your Highpoint ATA-Raid-0-Array after you'd killed it while trying to install GRUB

This is how I had done it

After installing Gentoo according to the Install-Guide and setting up Grub as Bootloader, I got some nice error-screen from the Highpoint ATA-Raid controller, saying the raid is destroyed...

Some ideas not working
  • First we tried to clone the MBR of HD2 to HD1 - not working
  • Then tried many other things - all not working
  • Later we tried some things with two other HDD's (I'll call them HD3&HD4) and copied some blocks to HD1&2 - still not working

How we had done it
As you can imagine, it was a long way doing this the "try&error" way and we hadn't always restored all data we changed.
I'll now describe the whole changes we had done to the disks, even if some of them aren't realy nessesary or even be foolish.
If you try this by yourself, maybe you'll backup your data (described below) and then skip Step1 and only do Step2. There is IMHO a good chance that this will be working fine. (PS: If you do so, please send back your experience)

This will not describe a full backup, but it describes how to backup and restore those sectors of your disk that you are going to change.
  • Move your defektive raid-disks from the raid-controler to a simple IDE-controler
  • Boot with your Gentoo-Install-CD or whatever you want to use and mount your backup medium (e.g.: USB-Stick, HDD, Digicam, Network Drive, etc...) to /mnt/backup and switch into this direktory
    mkdir /mnt/backup
    mount /dev/sda1 /mnt/backup
    cd /mnt/backup

    (sda1 was our USB-Watch, you should replace it with whatever you need)

    This will back up your first 10000 bytes of data from HD1&2 into the files called hda10000 and hdb10000

    dd if=/dev/hda of=hda10000 bs=10000 count=1
    dd if=/dev/hdb of=hdb10000 bs=10000 count=1

    (/dev/hda and /dev/hdb are the two disks from the raid array, change it to your needs)

    you can restore this backup whenever you want:

    dd if=hda10000 of=/dev/hda bs=10000 count=1
    dd if=hdb10000 of=/dev/hdb bs=10000 count=1

This step may or may not be nessesary - we had done it, so we include it here - maybe you'll do some testings and report your feedback

  • Take two empty disks (HD3, HD4) of whatever size you have, connect them to your RAID-Controller and create a new RAID-Array. Use the same block size and Array-name you had used for your broken array
  • Move those two disks to your normal IDE-controler (unplug HD1&HD2 and plug in HD3&4 instead)
  • copy the first 5103 bytes of these disks to a file
    (mount your /mnt/backup directory, switch to it... like you had done for the backup)

    dd if=/dev/hda of=hda5103new bs=5103 count=1
    dd if=/dev/hdb of=hdb5103new bs=5103 count=1

    Note: I don't know if this size is always the same. You should check this with:

    less hda5103new

    and verify that the last bytes of this file are "Your Array-name in here" (It's the one you used before while creating your new array)
    Your Array-name should appear twice in this file!!!
    If the size of 5103 isn't right, then try&error until you get the right size
  • Unplug HD3&4 and replug HD1&2 there
  • Overwrite the first 5103 bytes of those drives
    (mount, ... )

    dd if=hda5103new of=/dev/hda bs=5103 count=1
    dd if=hdb5103new of=/dev/hdb bs=5103 count=1

    This will delete everything GRUB installed to those sectors and maybe some more data I don't know about

  • Now reatach those disks (HD1&2) to your RAID-controller and delete the broken array
  • Create a new Array with the same settings you had done before
  • Move HD1&2 again to your normal IDE-controler
  • Restore your old partition-table:

    dd if=/dev/hda of=hda512 bs=512 count=1
    dd if=/dev/hdb of=hdb512 bs=512 count=1

    dd if=hda10000 of=/dev/hda bs=510 count=1
    dd if=hdb10000 of=/dev/hdb bs=510 count=1

    dd if=hda512 of=/dev/hda bs=446 count=1

    dd if=hdb512 of=/dev/hdb bs=446 count=1

    This is some bit confusing and there is surly a better way of doing this
    (what you had done with this is overwriting byte 447 to 510 of your new array with those of your old (defektive) array)
    (byte 447 to 510 are in fact the partition tables of your hdds)
  • Replug your disks to the RAID-controller


Install LILO (until you want to retry it with GRUB)

now everything should work fine

... we did so and restored a 240GB Raid-0-Array with 7 NTFS, 1 SWAP and 2 reiserFS partitions. WinXP is running without any problems again and after one or two more tries, I'm sure I'll get a running Kernel compiled :D

EDIT: changed layout to be easier to read
Back to top
View user's profile Send private message

Joined: 29 Dec 2005
Posts: 3

PostPosted: Sun Nov 04, 2007 7:17 am    Post subject: Here's how I did it Reply with quote

Here's how I did it. The MBR gets screwed by grub, thus we need to recreate MBR as it was before.

NOTE: Please make sure you do not write anything to the disks which were part of the raid.

Kudos to
* Christophe GRENIER the author of testdisk, he is a GOD among men for writing testdisk and making it GPL (free as in beer!!!).

My Paritions setup
1. Linux - Pirmary
2. XP - Primary
3. Extended
4. NTFS - Logical
5. Linux - Logical
6. Linux - Logical

Steps to recover.
1. Attached another hard drive to the computer and install xp.
2. Destroy your raid and re-create the raid using the SAME STRIPE SIZE.
3. Run testdisk ( to recover lost partitions and make the partition you usually boot from as bootable. NOTE: you can check that the correct partitions are found by listing their files.
4. Remove the newly attached hard drive from the bios (you won't need it anymore) :lol:
5. Reboot and watch as your previous system boots up. 8) All the files, everything is still there just as you had left it.

I could have created a xp boot disk and placed the test disk program on that, instead of attaching the additional hard drive and installing xp on it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum