Linux RAID management utilities?

Paul Lussier p.lussier at comcast.net
Tue Sep 25 22:54:49 EDT 2007


Bill McGonigle <bill at bfccomputing.com> writes:

> On Sep 24, 2007, at 20:07, Paul Lussier wrote:
>
>> Wouldn't it just be something like:
>>   mdadm /dev/md0 --assemble --uuid=<insert UUID here> /dev/sda1 /
>> dev/sdb1 ...
>
> Yeah, that's what the tool would output.  The input would be like
> "addall /mnt/backup" or something.

Huh?  What tool?  mdadm *is* the tool.  You can get the UUID of a
given raid set by querying the device with mdadm:

  # mdadm -D /dev/md0 |egrep 'dev|UUID'
  /dev/md0:
         0       3        1        0      active sync   /dev/hda1
         1      22        1        1      active sync   /dev/hdc1
             UUID : 25815b8c:1735351e:aa21466a:f14221c1

If the md device isn't currently active, and you need the UUID, query
one of the devices which comprise that md device:

  # mdadm -E /dev/hda1 |egrep 'dev|UUID'
  /dev/hda1:
             UUID : 25815b8c:1735351e:aa21466a:f14221c1
  this     0       3        1        0      active sync   /dev/hda1
     0     0       3        1        0      active sync   /dev/hda1
     1     1      22        1        1      active sync   /dev/hdc1

So, now you should be able to do something like:

 mdadm /dev/md0 \
       --assemble --uuid='25815b8c:1735351e:aa21466a:f14221c1' \
       /dev/hd[ae]1

And have your md device running.
-- 
Seeya,
Paul


More information about the gnhlug-discuss mailing list