Hardcore Linux

Anything about Ubuntu, Centos, openSuSe and Fedora

Recover data from a RAID partition

Raids and LVM  are very vital to a Linux server, but then again it’s one hell of a complex step recovering data from a crashed linux system. In this tutorial, I’ll try to help you recover your data on a RAID partition.

But first, let me discuss the tool I’ll be using, for this tutorial, I will use SystemRescueCD, a gentoo-based system recovery distro which for me is the far easiest tool in recovering crashed system. So back to our topic, here’s how:

1. After a clean boot on your SystemRescueCD liveCD, create your /etc/mdadm.conf

mdadm --examine --scan /dev/sda1 >> /etc/mdadm/mdadm.conf

2. Check your /etc/mdadm/mdadm.conf , it must contains something like this:

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=a28090aa:6893be8b:c4024dfc:29cdb07a

3. On the last part of that line, add the following:

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=a28090aa:6893be8b:c4024dfc:29cdb07a devices=/dev/sda1,missing

The string /dev/sda1 is the hardware device and missing means that the second disk in this RAID array is not present at the moment.

4. Now, start your raid setup

/etc/init.d/mdadm start
/etc/init.d/mdadm-raid start
 

5. Check if the device is properly configured.

cat /proc/mdstat

It should contain something like this:

md0 : active raid1 sda1[1]

6. If from the raid setup, then the inner filesystem is ext3, then you just need to mount it to a temporary directory

mount /dev/md0 /mnt/recover

7. Done.


smb://rnartos@server/scan/uicscn4182.pdf mdadm –examine –scan /dev/hda1 >> /etc/mdadm/mdadm.conf

One response to “Recover data from a RAID partition

  1. lefty.crupps November 9, 2010 at 2:52 am

    So very helpful, thank you much!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: