Skip to end of metadata
Go to start of metadata

Say What?

Recently I had a power failure which, in lieu of my wonderful UPS / NUT setup, resulted in a hardware failure with one of my servers. Continuing my streak of horrific luck, my UPS gave out 3 seconds before the power came back on. Furthermore, I didn't tweak the remaining battery percentage before NUT sends the shutdown command to all my boxes so one of them (the most crucial one) didn't have enough time to power down. As a result, I now have my most important server no longer able to POST. Sweet.

It was inevitable I guess. The days of running a mini datacenter with business class internet are over - just ended a little premature. So how do I get the data off my server which no longer powers up?

What I Had

Before the death of the box, I was running a Xen host with 7 guests. These VMs were running off a software RAID 5 comprised of SATA drives with LVM on top of that. Each partition within the VM had its own logical volume. So, in order to recover data from this box, I needed:

  1. A server which would actually POST (thankfully I had one lying around)
  2. A server with at least 3 SATA ports
  3. A KNOPPIX CD
  4. Some free time

The Recovery

After I downloaded the latest KNOPPIX CD, it was time to boot up and start recovering some data. Unfortunately this wasn't a simple 'boot into KNOPPIX, mount the partition, call it a day' kind of ordeal. 2 things made this relatively complex: RAID and LVM. So ...

Note

Although above I speak of a RAID 5 of 3 SATA drives being the culprit, I first tested this out with the server that didn't die which contained a RAID 1 of 2 SATA drives. Thus these instructions were based on the 2 drive setup, not the one which I'll be performing the actual recovery with.

  1. Boot into KNOPPIX.
  2. Ensure all the devices are there. In my case, I ran something like
  3. Before we get to assembling the array, let's load some modules if they're not already loaded:
  4. Now it's time to recreate the RAID. First, it might be helpful to use mdadm to read the RAID information.
  5. This will give you an idea of how the RAID was setup when it was originally running. Take note to the RAID device (i.e. /dev/md*).
  6. If it doesn't already exist, create the device
  7. Now assemble the RAID array
  8. Make sure the RAID looks legit
  9. Now you should be able to see your logical volumes. Run some basic LVM commands to make sure things are in working order
  10. You might find that your logical volumes are inactive. To activate each logical volume, run
    Obviously being sure to replace volume_group and logical_volume with the appropriate names. If you are unsure, running lvscan will tell you any inactive volumes you may have. Simply plug in the full path of the volume from this output to the lvchange command and you should be in business.
  11. Finally, mount the logical volume as you normally would.

Ta dah!

Labels:
  1. Nov 17, 2009

    Anonymous

    This post saved me!  Thank you!!!

    One additional thing I did was to map which drive goes to which raid since I am running (2) raid 1 and (1) raid 5 on (4) 1 TB drives.  I ran "mdadm --examine --scan /dev/sda" for for each /sd* entry and wrote down which one was showing which md*.  This eliminated my confusion as to which drive was part of which array.  I don't know if it made a difference or not, I suppose I am just paranoid. 

    Thank you again for the post.

    1. Nov 06, 2011

      Anonymous

      Pe6aOo , [url=http://dlyghmteakki.com/]dlyghmteakki[/url], [link=http://nplkmmlyerny.com/]nplkmmlyerny[/link], http://voqoratfmqky.com/
    2. Nov 09, 2011

      Anonymous

      seWSNt , [url=http://ezebmrveekch.com/]ezebmrveekch[/url], [link=http://jtyxxfconbmk.com/]jtyxxfconbmk[/link], http://mczsiiebdqua.com/
  2. Mar 14, 2011

    Anonymous

    This software is good,but i still believe apple site software for data recovery mac http://www.apple.com/downloads/macosx/system_disk_utilities/filerecovery.html

    1. Nov 07, 2011

      Anonymous

      vLZ0eD , [url=http://ovmcowzahanb.com/]ovmcowzahanb[/url], [link=http://yqgkppkzlmvm.com/]yqgkppkzlmvm[/link], http://iwfjhwzvfudv.com/