Bug#336789: mdadm and multilevel raid startup at boot
Sergey Belikov
bsu at lab321.ru
Tue Feb 14 12:36:33 UTC 2006
To make second level of RAID devices start on boot you must write
/etc/mdadm/mdadm.conf file.
Without config file mdadm can't find components of an MD array
on RAID devices.
Example config:
DEVICE partitions
# this is single line
ARRAY /dev/md4 level=raid0 num-devices=4
UUID=7f9baa50:cb9fc05b:a02da134:a89119a1
devices=/dev/md0,/dev/md1,/dev/md2,/dev/md3
# end of line
And second level MD array MUST be created as new array
with per-device superblocks (option "-C").
A lot of details follow :-)
=============================================================
Creating and configurating command list:
--------------------
mdadm -C /dev/md0 -c128 -l1 -n2 /dev/sd[a,e]2
mdadm -C /dev/md1 -c128 -l1 -n2 /dev/sd[b,f]2
mdadm -C /dev/md2 -c128 -l1 -n2 /dev/sd[c,g]2
mdadm -C /dev/md3 -c128 -l1 -n2 /dev/sd[d,h]2
mdadm -C /dev/md4 -c128 -l0 -n4 /dev/md[0,1,2,3]
cat << 'EOF' > /etc/mdadm/mdadm.conf
DEVICE partitions
EOF
mdadm --examine --scan >>/etc/mdadm/mdadm.conf
I have software RAID on Promise SATA controller, so sata_promise module must
be loaded before md-mod (workaround for "bug" 287415):
cat << 'EOF' >> /etc/modules
sata_promise
raid1
raid0
EOF
--------------------
Configuration details:
=============================================================
Hardware:
2 SATA 4-port controller
Promise Technology, Inc. PDC20318 (SATA150 TX4) (rev 02)
8 SATA HDD Seagate Barracuda Model: ST380817AS
--
Integrated IDE interface:
VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C
PIPC Bus Master IDE (rev 06)
1 PATA HDD Seagate Barracuda Model: ST380011A
=============================================================
Software:
Package: mdadm
Version: 1.9.0-4sarge1
$cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line. Comments begin with
# a "#", and everything on the line after them are ignored.
ide-cd
ide-disk
ide-generic
psmouse
sd_mod
sata_promise
raid1
raid0
$cat /etc/mdadm/mdadm.conf
DEVICE partitions
# Level 1
ARRAY /dev/md0 level=raid1 num-devices=2
UUID=364b9dc0:54d8de44:27609da9:cd7905f5
devices=/dev/sde2,/dev/sda2
ARRAY /dev/md1 level=raid1 num-devices=2
UUID=90b82738:0030610a:347533da:6ffca95a
devices=/dev/sdf2,/dev/sdb2
ARRAY /dev/md2 level=raid1 num-devices=2
UUID=a8ab482d:cab0594a:f9dd42ec:7be9e4e0
devices=/dev/sdg2,/dev/sdc2
ARRAY /dev/md3 level=raid1 num-devices=2
UUID=18246c78:72ff6a61:1598cf00:58b98e52
devices=/dev/sdh2,/dev/sdd2
# Level 2
ARRAY /dev/md4 level=raid0 num-devices=4
UUID=7f9baa50:cb9fc05b:a02da134:a89119a1
devices=/dev/md0,/dev/md1,/dev/md2,/dev/md3
$cat /proc/mdstat
Personalities : [raid0] [raid1]
md4 : active raid0 md0[0] md3[3] md2[2] md1[1]
186706432 blocks 128k chunks
md3 : active raid1 sdd2[0] sdh2[1]
46676736 blocks [2/2] [UU]
md2 : active raid1 sdc2[0] sdg2[1]
46676736 blocks [2/2] [UU]
md1 : active raid1 sdb2[0] sdf2[1]
46676736 blocks [2/2] [UU]
md0 : active raid1 sda2[0] sde2[1]
46676736 blocks [2/2] [UU]
unused devices: <none>
# mdadm -D /dev/md[01234]
/dev/md0:
Version : 00.90.03
Creation Time : Mon Feb 13 18:19:27 2006
Raid Level : raid1
Array Size : 46676736 (44.51 GiB 47.80 GB)
Device Size : 46676736 (44.51 GiB 47.80 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Feb 13 19:38:37 2006
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 364b9dc0:54d8de44:27609da9:cd7905f5
Events : 0.5
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 66 1 active sync /dev/sde2
/dev/md1:
Version : 00.90.03
Creation Time : Mon Feb 13 18:19:52 2006
Raid Level : raid1
Array Size : 46676736 (44.51 GiB 47.80 GB)
Device Size : 46676736 (44.51 GiB 47.80 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 1
Persistence : Superblock is persistent
Update Time : Mon Feb 13 19:38:37 2006
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 90b82738:0030610a:347533da:6ffca95a
Events : 0.5
Number Major Minor RaidDevice State
0 8 18 0 active sync /dev/sdb2
1 8 82 1 active sync /dev/sdf2
/dev/md2:
Version : 00.90.03
Creation Time : Mon Feb 13 18:20:00 2006
Raid Level : raid1
Array Size : 46676736 (44.51 GiB 47.80 GB)
Device Size : 46676736 (44.51 GiB 47.80 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 2
Persistence : Superblock is persistent
Update Time : Mon Feb 13 19:38:36 2006
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : a8ab482d:cab0594a:f9dd42ec:7be9e4e0
Events : 0.4
Number Major Minor RaidDevice State
0 8 34 0 active sync /dev/sdc2
1 8 98 1 active sync /dev/sdg2
/dev/md3:
Version : 00.90.03
Creation Time : Mon Feb 13 18:20:07 2006
Raid Level : raid1
Array Size : 46676736 (44.51 GiB 47.80 GB)
Device Size : 46676736 (44.51 GiB 47.80 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 3
Persistence : Superblock is persistent
Update Time : Mon Feb 13 19:38:36 2006
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 18246c78:72ff6a61:1598cf00:58b98e52
Events : 0.4
Number Major Minor RaidDevice State
0 8 50 0 active sync /dev/sdd2
1 8 114 1 active sync /dev/sdh2
/dev/md4:
Version : 00.90.03
Creation Time : Mon Feb 13 19:38:36 2006
Raid Level : raid0
Array Size : 186706432 (178.06 GiB 191.19 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 4
Persistence : Superblock is persistent
Update Time : Mon Feb 13 19:38:36 2006
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Chunk Size : 128K
UUID : 7f9baa50:cb9fc05b:a02da134:a89119a1
Events : 0.8
Number Major Minor RaidDevice State
0 9 0 0 active sync /dev/md0
1 9 1 1 active sync /dev/md1
2 9 2 2 active sync /dev/md2
3 9 3 3 active sync /dev/md3
-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.15
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages mdadm depends on:
ii debconf 1.4.30.13 Debian configuration management sy
ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an
ii makedev 2.3.1-77 creates device files in /dev
-- debconf information:
* mdadm/autostart: true
* mdadm/mail_to: admins at lab321.ru
* mdadm/warning:
* mdadm/start_daemon: true
=============================================================
-- http://www.lab321.ru/ -- Laboratory System 321, Omsk, Russia --
More information about the pkg-mdadm-devel
mailing list