RHCE2B.COM
Next Previous Contents

12. RAID

12.1 Overview

Stands for Redundant Array of Inexpensive Disks or Redundant Array of Independent Disks. It uses multiple disks to increase performance and/or reduce the chances of data loss due to hardware failure.

12.2 Supported Versions

  1. Striping (RAID 0)

  2. Mirroring (RAID 1)

  3. Data and Parity Striping (RAID 5)

12.3 Partition Type

Set partition type to 0xFD for auto detection of RAID devices (use option 't' in fdisk).

12.4 Configuration File (/etc/raidtab)

See raidtab man page for an example.

Sample file:

### RAID 1
raiddev               /dev/md0
raid-level            1         # Mirroring
nr-raid-disks         3         # Number of disks to use
nr-spare-disks        1         # Hot standby in case another fails
persistent-superblock 1         # Required for auto detection
chunk-size            32        # In KB

device                /dev/hda3
raid-disk             0
device                /dev/hdb3
raid-disk             1
device                /dev/hde5
raid-disk             2
device                /dev/hdc4
spare-disk            0

### RAID 5
raiddev               /dev/md1
raid-level            5         # Data and parity striping
nr-raid-disks         3         # Number of disks to use
nr-spare-disks        1         # Hot standby in case another fails
persistent-superblock 1         # Required for auto detection
chunk-size            32        # In KB
parity-algorithm      right-symmetric

device                /dev/sda1
raid-disk             0
device                /dev/sdb3
raid-disk             1
device                /dev/sdc5
raid-disk             2
device                /dev/sdd4
spare-disk            0

12.5 Initializing RAID devices

mkraid /dev/md0
mkraid /dev/md1
NOTE: mkraid also causes necessary RAID modules to be loaded by kernel as if raidstart had been executed.

12.6 Formatting RAID devices

mke2fs -b 4096 -R stride=8 /dev/md0
mke2fs -b 4096 -R stride=8 /dev/md1

"-R" is used to set RAID related options for the file system. Stride is the number of blocks per chunk. In the previous examples we are using a 32K chunk size with a 4K block size, so stride has to be 8 (4K * 8 = 32K).

12.7 RAID 5 parity options

Specify parity algorithm with the "parity-algorithm" option in /etc/raidtab. Possible values are:

  1. left-asymmetric
  2. right-asymmetric
  3. left-symmetric
  4. right-symmetric

Left-symmetric offers the maximum performance on typical disks with rotating platters.

12.8 Auto detection of RAID arrays

Requires:

  1. Partition type must be set to 0xFD.
  2. Auto detection must be turned on in kernel.
  3. Must specify "persistent-superblock 1" in /etc/raidtab


Next Previous Contents
ERROR!!


Linux Waves Banner Exchange
RHCE2B.COM Home Page
RHCE2B.COM Practice Test for the RHCE exam
Legal stuff