Skip to contentSkip to conversation

raidtab -> mdadm conf file?

DISCUSSION Robert L. Harris 2 participants 4 messages Feb 19, 2003 MD RAID

lore
Share & tools
lore
#0 lore raw

I currently have about 30 machines using raidtools and /etc/raidtab.
Does anyone have a script that will generate a complete mdadm conf file based on a raidtab or output from mdadm --detail? While mdadm may not need need the conf file once it's built etc I like to keep them around in the event we have to rebuild an array that's destroyed (2+ disks out of a RAID5 Array)) to an identicle, standard format.

Robert

:wq!
---------------------------------------------------------------------------
Robert L. Harris | PGP Key ID: E344DA3B

                                         @ x-hkp://pgp.mit.edu 

DISCLAIMER:
These are MY OPINIONS ALONE. I speak for no-one else.
FYI:
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'

#1 lore raw
Quoted 3 lines · Robert L. Harris

I currently have about 30 machines using raidtools and /etc/raidtab.
Does anyone have a script that will generate a complete mdadm conf file based on a raidtab or output from mdadm --detail? While mdadm may

Assuming the arrays are operational you could do something like:

# echo "DEVICES /dev/sd*" > /etc/mdadm.conf
# mdadm --detail --scan >> /etc/mdadm.conf

Just adjust the first command so that it has the desired device set.

--
Derek Vadala, [email protected], http://www.cynicism.com/~derek

#2 lore raw

What should the output of "mdadm --detail --scan" look like?

root@disk2:~# mdadm --detail --scan
mdadm: option s not valid in mode D

Thus spake Derek Vadala ([email protected]):

Quoted 9 lines · Robert L. Harris
Quoted 4 lines

I currently have about 30 machines using raidtools and /etc/raidtab.
Does anyone have a script that will generate a complete mdadm conf file based on a raidtab or output from mdadm --detail? While mdadm may

Assuming the arrays are operational you could do something like:

Quoted 7 lines
# echo "DEVICES /dev/sd*" > /etc/mdadm.conf
# mdadm --detail --scan >> /etc/mdadm.conf

Just adjust the first command so that it has the desired device set.

--
Derek Vadala, [email protected], http://www.cynicism.com/~derek

:wq!
---------------------------------------------------------------------------
Robert L. Harris | PGP Key ID: E344DA3B

                                         @ x-hkp://pgp.mit.edu 

DISCLAIMER:
These are MY OPINIONS ALONE. I speak for no-one else.
FYI:
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'

#3 lore raw
Quoted 5 lines · Robert L. Harris

What should the output of "mdadm --detail --scan" look like?

root@disk2:~# mdadm --detail --scan
mdadm: option s not valid in mode D

A series of array entries like such (one for each array that's running):

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=8b9bafc6:ed98bbd6:83d1c10f:d388a65f ARRAY /dev/md6 level=raid1 num-devices=2 UUID=98079ef1:26a71e58:a91327d9:ada25de7 etc....

Which version of mdadm are you working with?

--
Derek Vadala, [email protected], http://www.cynicism.com/~derek