Managing RAID on Linux - Derek Vadala [63]
dev.raid.speed_limit_max = 50000
Consult the manual pages for sysctl and sysctl.conf for further details.
raidtools
raidtools is the traditional package used to manage software arrays. Although the newer mdadm is more feature-rich, raidtools is in wider use throughout the software RAID community. While it's a bit more complex to manage arrays using raidtools, the package has proved reliable for many years. raidtools has remained at version 0.90 for several years, but the prerelease for version 1.0 of raidtools became available during the course of this writing, although it has not been officially released yet. The new version has some new utilities, including a tool that allows users to generate /etc/raidtab files by querying an active array, which is very useful if you've accidentally deleted your /etc/raidtab file. The additions to version 1.0 are covered in this section, but keep in mind that I used a narrowly released beta version during my testing, and that some functionality might have changed since then.
Version 1.0 fixes several known bugs in the 0.90 release of raidtools. raidtools-20010914 (version 0.90.0), in addition to having some minor bugs, was released without a vital utility, raidsetfaulty.This utility is used to manually induce a disk failure and had been included with previous releases. Instead, raidtools-20010914 shipped with a new program named raidhotgenerateerror, whose name makes it look like a replacement for raidsetfaulty. Unfortunately, raidhotgenerateerror does not perform the same function as raidsetfaulty and should not be used as a replacement. raidhotgenerateerror is merely a utility for testing error handling in the md driver. This has caused some confusion among Linux RAID users. Because of these inconsistencies, I advise against using raidtools-20010914. Instead, download and use the previous release raidtools-19990824 from ftp.kernel.org/pub/daemons/raid/alpha. If you are working with a version of raidtools that came installed with your distribution, check to see if you have /sbin/raidsetfaulty on your system. If it doesn't exist, then it's likely that you are working with a repackaged version of raidtools-20010914. In that case, I recommend installing the previous version from source, or using a newer version if one is available and tested. The beta version of raidtools-1.0 corrects many of the problems with the raidtools-20010914 release and also contains raidsetfaulty. It likely that raidtools-1.0 will be in wide release by the time this book is in print.
The /etc/raidtab File
The current raidtools package requires a configuration file, which, by default, is named /etc/raidtab. The /etc/raidtab file contains a stanza about each software array connected to the system. (A stanza is a collection of keywords and variables that describe a single array.) The configuration is parsed from top to bottom so that previously defined arrays may be used in subsequent stanzas. This is useful when creating hybrid arrays like RAID-10, but it also means that the order of the stanzas in /etc/raidtab is extremely important. Each stanza begins with a raiddev directive and continues with other directives from the following list.
raiddev mddevice
The raiddev parameter begins the configuration of an array. All subsequent directives are assumed to refer to the most recent raiddev directive. raiddev takes the full path to the device block special file as its argument (for example, raiddev /dev/md2). A unique raiddev directive is required for each array.
raid-level level
raid-level specifies the mode of the current array. This parameter takes an alphanumeric value (see Table 4-1) that corresponds to kernel RAID levels.
Table 4-1. raid-level parameters
raidtab entry
Description
linear
Linear concatenation
0
Striping
1
Mirroring
4
Single parity drive
5
Distributed parity
multipath
Multipath I/O
Each raid-level directive defined in /etc/raidtab corresponds to the previously defined raiddev entry. In addition, support for the