Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had a 2-drive RAID-1 array running on ubuntu, which I had forgotten about. The host I was running them on is now dead, leaving me with these two disks. How can I get data off of them? If I dump them- using dd or the such- how can I read that data in a useful format?

share|improve this question
    
mdadm has no problem with reading from and creating a device for an array from a different host. Have you scanned and/or checked /proc/mdstat? –  Shane Madden Jul 4 '12 at 1:44

2 Answers 2

up vote 2 down vote accepted

mdadm stores all the array data on the disks themselves and is highly portable between the same or newer versions. Assuming the mirroring was up-to-date, you can even read the data off a single disk via e.g. a USB adapter. (Of course, having backups would reduce the need to do any of this).

All of these steps could be done from a running system but a LiveCD etc. will work just about as well:

  1. Attach the drives to the system you want to use to recover the data
  2. Find the partition/disk info with dmesg output, sudo fdisk -l etc.
  3. Find the mdadm metadata from the disks (use your own disk values here):

    $ sudo mdadm --examine /dev/sda1
    $ sudo mdadm --examine /dev/sdb1
    

    The "Preferred Minor" value will tell you which array (e.g. /dev/md0) the disks were part of.

  4. Assemble the array:

    $ sudo mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1
    

    If everything is OK, you'll get a message like "md0 started with 2 devices"; check /proc/mdstat to be certain.

  5. If the array had a partition table, use fdisk -l to find it and mount the correct partition (kpartx can be useful here); otherwise, simply mount /dev/md0 /mnt/temp as appropriate

Mounting a single disk may or may not "just work" as 3dinfluence said, depending on the mdadm metadata location; to be sure, you can assemble with a single member using

$ mdadm --assemble /dev/md0 /dev/sda1 --run.
share|improve this answer
    
Got it all back this way, worked great just re-creating the array.. Thanks! –  alicht Jul 4 '12 at 4:42

With RAID1 you can simply mount the drive as if it were a single drive.

So put the drive in another computer and for instance if the drive was at /dev/sdb run mount /dev/sdb1 /mnt/ You may have to specify the file system. So mount -t ext4 /dev/sdb1 /mnt/ for instance if the old volume was ext4.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.