I have four drives containing mdadm RAID partitions: /dev/sda1 through /dev/sdd1
I believe they were previously set up as RAID5, although it might have been two separate RAID1 arrays or one RAID10 array.
How do I work out what they were, which drive is which, and configure the array on a new PC to access the data? (Obviously I need to do that without losing the data on them!)
Mark Rogers
On 27/11/12 13:37, Mark Rogers wrote:
I have four drives containing mdadm RAID partitions: /dev/sda1 through /dev/sdd1
I believe they were previously set up as RAID5, although it might have been two separate RAID1 arrays or one RAID10 array.
How do I work out what they were, which drive is which, and configure the array on a new PC to access the data? (Obviously I need to do that without losing the data on them!)
Pretty much it should be fairly automatic if you install them on a PC with the mdadm tools and kernel modules or run a live CD.
The magic numbers written to each raid partition will tell mdadm what order to assemble the drives in and what raid level it was. You don't need to match up device names with the old system etc.
Just boot it up cat /proc/mdstat, (if it exists it has already found the array's) if not then then prod it with a 'mdadm -A /dev/md0' and md1 2 etc if you think more than one array existed or just running 'mdadm -A --scan' should assemble all arrays it can find on the attached devices. md will figure out the drive order and the raid level. 'cat /proc/mdstat' to see what is going on.
Some distros run the scan option at boot so you may find the array just magically appears so it is worth checking /proc/mdstat before you start.
Be aware that over the last couple of years there have been some changes in the mdadm metadata format which means that older versions of mdadm cannot assemble arrays created by the later versions. But the new versions are backward compatible...so I would make sure you run a system with a recent mdadm version of 1.2 or higher.
On 27/11/12 13:37, Mark Rogers wrote:
I have four drives containing mdadm RAID partitions: /dev/sda1 through /dev/sdd1
I believe they were previously set up as RAID5, although it might have been two separate RAID1 arrays or one RAID10 array.
How do I work out what they were, which drive is which, and configure the array on a new PC to access the data? (Obviously I need to do that without losing the data on them!)
Hi,
When I had a raid problem, I googled and found loads of stuff about how to recover a disk, so there's loads of info out there - perhaps a confusing amount!
This one may help. http://ubuntuforums.org/showthread.php?t=1950154
From it, you could use
sudo mdadm --examine /dev/sd*
which will tell you details about the disks, including the array uuids with which, you should be able to work out how many raids you had.
If all's well, you could try
mdadm --detail --scan
mdadm --assemble --scan
will try to work out which disks are part of which array, and add them.
If that doesn't work, you may have to manually add the disks to the array using mdadm, but I can't find an example to hand of how to do that.
You'll have to ensure that your mdadm.conf file is up to date too, otherwise this won't mount after a boot.
I don't know if this step is required in all situations, but I had to do
sudo update-initramfs -u
which updates the initial ram file system used when booting the system take the new array into account, but I'm booting from raid disks, so this may not apply to you.
Hope that helps Steve