Saturday 13 April 2019

linux - Recovering data from a RAID 0 array


I have an Intel software RAID 0 setup with two 500GB disks (i.e. "fakeraid"). The metadata on one of the disks has been lost and so the array will no longer activate.


I know the order of the disks, the stripe size, and the total size of the RAID set. Using this information, is there any way to force either dmraid, mdadm or something else to activate the array so that I can (hopefully) back up as much data as possible before the faulty disk completely dies?


EDIT:


I should probably point out that the RAID volume was partitioned using GPT rather than MBR, so it should be possible to restore the partition table from the backup even if it gets nuked in the process of re-activating the array.



Answer



I figured it out for myself (sorry, I probably should have poked around a bit more before I asked this question, but I was a bit paranoid about breaking anything).


Please note that this only worked because I have a GUID partition table. From this day forward I will use this as an example of how amazing GPT is.



  1. Reboot the computer, enter RAID configuration (Ctrl-I)

  2. Destroy the RAID array and recreate it using the same stripe size and array size as before

  3. Boot an Ubuntu Live CD

  4. Add universe to /etc/apt/sources.list

  5. Install gdisk

  6. Use gdisk to restore the GPT header and partition table from the backup at the end of the disk

  7. Restart, all my stuff is back!


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...