[plug] Recovering a raid setup after a new install

Matt Kemner zombie at penguincare.com.au
Wed Jan 17 15:13:52 WST 2007


Hi Nigel

On Tue, 16 Jan 2007, quoth Nigel:

> A friend from another state just sent me an email. He has a
> server with 5 drives. 1 40gb for the OS. 2 setup in raid0 and 2
> setup in raid1. He had Ubuntu 6.06 on the OS drive wich he said
> he wiped and replaced with Ubuntu 6.10.

First thing to do: cat /proc/mdstat

That should tell you what RAID arrays the kernel currently knows about.

If it doesn't show any active RAID devices, then you will need to manually
reconstruct the array. You can use the mdadm tool for this.

First use mdadm to examine each RAID partition.
It will tell you what kind of RAID device it belongs to, and will even
tell you whether it was previously part of /dev/md0 or /dev/md1 (or
whatever)

For example:

allison:~# mdadm -E /dev/sda2
/dev/sda2:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : d48f4b67:9a127187:ccb53995:38349a06
  Creation Time : Fri Jun 23 01:03:37 2006
     Raid Level : raid1  ## Raid level this partition belongs to
   Raid Devices : 3
  Total Devices : 5
Preferred Minor : 0      ## this means /dev/md0 - 1 would be md1


Once you know which drive goes where, you can reassemble the array with
(for example)

mdadm -A /dev/md0 -a /dev/sda2 -a /dev/sdb2

  -A means assemble this array, and -a says "add this drive"

Then "/proc/mdstat" will tell you the current status of the array
(the RAID0 array will be resynchronising the two drives)

Kind Regards,

 - Matt Kemner             Perth:     Tel 08 9322 3444 Fax 08 9221 3444
  Penguin Care             Adelaide:  Tel 08 8311 1144 Fax 08 8311 1177
  Linux & VoIP Specialist  Melbourne: Tel 03 8648 6644 Fax 03 8648 6677
  Mobile: 04 2022 3444     Brisbane:  Tel 07 3337 9988 Fax 07 3337 9977




More information about the plug mailing list