6.3. Managing Software RAID
This section discusses software RAID configuration and management after the installation, and covers the following topics:
- Reviewing existing software RAID configuration.
- Creating a new RAID device.
- Replacing a faulty device in an array.
- Adding a new device to an existing array.
- Deactivating and removing an existing RAID device.
- Saving the configuration.
All examples in this section use the software RAID configuration from the previous section.
6.3.1. Reviewing RAID Configuration Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
When a software RAID is in use, basic information about all presently active RAID devices are stored in the
/proc/mdstat
special file. To list these devices, display the content of this file by typing the following at a shell prompt:
cat /proc/mdstat
cat /proc/mdstat
To determine whether a certain device is a RAID device or a component device, run the command in the following form as
root
:
mdadm --query device…
mdadm --query device…
In order to examine a RAID device in more detail, use the following command:
mdadm --detail raid_device…
mdadm --detail raid_device…
Similarly, to examine a component device, type:
mdadm --examine component_device…
mdadm --examine component_device…
While the
mdadm --detail
command displays information about a RAID device, mdadm --examine
only relays information about a RAID device as it relates to a given component device. This distinction is particularly important when working with a RAID device that itself is a component of another RAID device.
The
mdadm --query
command, as well as both mdadm --detail
and mdadm --examine
commands allow you to specify multiple devices at once.
Example 6.1. Reviewing RAID configuration
Assume the system uses configuration from Figure 6.7, “Sample RAID Configuration”. You can verify that
/dev/md0
is a RAID device by typing the following at a shell prompt:
mdadm --query /dev/md0
~]# mdadm --query /dev/md0
/dev/md0: 125.38MiB raid1 2 devices, 0 spares. Use mdadm --detail for more detail.
/dev/md0: No md super block found, not an md component.
As you can see, the above command produces only a brief overview of the RAID device and its configuration. To display more detailed information, use the following command instead:
Finally, to list all presently active RAID devices, type: