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?
2 Answers
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.

- 12,449
- 2
- 28
- 41
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:
- Attach the drives to the system you want to use to recover the data
- Find the partition/disk info with
dmesg
output,sudo fdisk -l
etc. 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.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.- If the array had a partition table, use
fdisk -l
to find it and mount the correct partition (kpartx
can be useful here); otherwise, simplymount /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.

- 8,002
- 3
- 36
- 44
-
Got it all back this way, worked great just re-creating the array.. Thanks! – alicht Jul 04 '12 at 04:42