Online Book Reader

Home Category

Managing RAID on Linux - Derek Vadala [65]

By Root 1356 0
is written into the RAID superblock during array initialization. If you determine that you need to adjust the chunk-size after your array is up and running, you will need to rebuild the array using mkraid or mdadm. Be advised that your data will be lost if you need to change the chunk-size for an array that has already been brought online. It is possible to adjust the chunk-size of an existing array using raidreconf, but all the caveats regarding raidreconf still apply. See the "raidreconf" reference entry later in this chapter.

* * *

device devpath

The device directive specifies the block special device of an individual array member. The full path to the block device should be used. The total number of device entries must equal the sum of the numbers defined by nr-raid-disks and nr-spare-disks. In an array with four nr-raid-disks and one nr-spare-disk, a total of five device entries are required. Each device entry must be paired with either a raid-disk or a spare-disk index entry.

raid-disk index

raid-disk takes an integer value that indicates the sequence number of a member disk. The value of the raid-disk directive should increase sequentially for each new device entry. After a new array is defined using raiddev, the index number for all device entries is reset. That is to say, each array has a separate list of member disks starting at zero.

spare-disk index

The spare-disk directive also takes an integer value beginning with zero. This parameter indicates the order of spare disks in an array. In the event of a disk failure, available spare disks will be brought online in the order in which they are indexed in /etc/raidtab.

parity-disk index

parity-disk specifies an out-of-sequence member disk as the parity drive in a RAID-4 array. Normally, the last member disk is used for parity. However, the parity-disk directive allows administrators to flag any member disk as a parity drive. This directive is accompanied by both a device entry and a raid-disk entry.

failed-disk index

The failed-disk parameter lets you flag one or more member disks as failed during array initialization. Flagging a device as failed can be useful for testing data redundancy without having to force a drive failure through a less gentle method. Flagging a device as failed also allows you to evaluate the performance of parity algorithms. Finally, the parameter can be used to create an array with a missing disk, which is a useful trick to use as part of migrating an existing system disk to software RAID. (See Converting to Software RAID in Chapter 7 for more details.) failed-disk takes an integer value beginning with zero. Much like the parity-disk directive, failed-disk should be accompanied by device and raid-disk entries.

raidtools Commands

The following referemce section describes the commands in the raidtools package. The fundamental command is mkraid command, which is responsible for creating a RAID device.

Name

lsraid

Synopsis

lsraid [mode] [options] -a mddevicelsraid [mode] [options] -d memberdevice

lsraid is included with release 1.0 of raidtools. It allows users to examine arrays and generate /etc/raidtab files by querying active arrays. lsraid is useful for checking devices, diagnosing problems, and recovering lost configuration files. lsraid was written by Joel Becker at Oracle Corporation.

Options

-A

Specifies array mode. Displays information about an array. When combined with the -a option, array mode will query an active array. When combined with the -d option, array mode will read the RAID superblock from a member disk instead of querying the array.

-D

Denotes disk mode. Displays information about member disks. When used with the -a option, disk mode returns information about each array member. When combined with -d, disk mode returns information about the specified member disks.

-R

Specifies raidtab mode. Queries an array or member disk and generates an /etc/raidtab file based on the RAID superblock it finds.

-a device

Selects an active md device to query. If the md device

Return Main Page Previous Page Next Page

®Online Book Reader