Using
mdadm
to Configure RAID-Based and Multipath Storage
235
Syncing disks...
Done.
22.3. Using
mdadm
to Configure RAID-Based and Multipath
Storage
Similar to other tools comprising the
raidtools
package set, the
mdadm
command can be used to
perform all the necessary functions related to administering multiple-device sets. This section explains
how
mdadm
can be used to:
• Create a RAID device
• Create a multipath device
22.3.1. Creating a RAID Device With
mdadm
To create a RAID device, edit the
/etc/mdadm.conf
file to define appropriate
DEVICE
and
ARRAY
values:
DEVICE /dev/sd[abcd]1
ARRAY /dev/md0 devices=/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1
In this example, the
DEVICE
line is using traditional file name globbing (refer to the
glob
(7) man page
for more information) to define the following SCSI devices:
•
/dev/sda1
•
/dev/sdb1
•
/dev/sdc1
•
/dev/sdd1
The
ARRAY
line defines a RAID device (
/dev/md0
) that is comprised of the SCSI devices defined by
the
DEVICE
line.
Prior to the creation or usage of any RAID devices, the
/proc/mdstat
file shows no active RAID
devices:
Personalities :
read_ahead not set
Event: 0
unused devices: none
Next, use the above configuration and the
mdadm
command to create a RAID 0 array:
mdadm C /dev/md0 level=raid0 raiddevices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 \
/dev/sdd1
Continue creating array? yes
mdadm: array /dev/md0 started.
Once created, the RAID device can be queried at any time to provide status information. The following
example shows the output from the command
mdadm --detail /dev/md0
:
/dev/md0:
Содержание ENTERPRISE LINUX 5 - VIRTUAL SERVER ADMINISTRATION
Страница 12: ...xii ...
Страница 20: ......
Страница 30: ...12 ...
Страница 32: ...14 ...
Страница 82: ...64 ...
Страница 106: ...88 ...
Страница 122: ...104 ...
Страница 124: ...106 ...
Страница 126: ......
Страница 132: ...114 ...
Страница 168: ...150 ...
Страница 182: ...164 ...
Страница 192: ...174 ...
Страница 194: ......
Страница 236: ...218 ...
Страница 238: ...220 ...
Страница 270: ......
Страница 274: ...256 ...
Страница 278: ...260 ...
Страница 292: ...274 ...
Страница 294: ......
Страница 300: ...282 ...
Страница 304: ......
Страница 316: ...298 ...
Страница 357: ...Creating Partitions 339 Figure 32 7 Creating a Software RAID Device 4 Click OK to add the device to the list ...
Страница 370: ...352 ...
Страница 384: ...366 ...
Страница 385: ...Part VII Appendix ...
Страница 386: ......