Objective 1: Configuring RAID

A RAID is a Redundant Array of Independent Disks. Sometimes it is more lovingly referred to as a Redundant Array of Inexpensive Disks, recalling RAID's roots in the search to create large disk storage from cheap, smaller-capacity hardware. While RAID is still used to maximize the use of inexpensive disks today, it is also used to achieve faster access speeds and data security.

RAID makes multiple hard disk drives look like one drive to the user's filesystem. There are multiple types of RAID, which are indicated by the level number. They achieve their effects through various combinations of mirroring and striping. Mirroring data refers to having identical copies of data in separate locations (disks). Striping data refers to distributing data across multiple disks, which involves more than a simple copy. RAID level 5 (referred to as RAID 5) is the most common form of RAID. RAID 5 uses striping with parity across your RAID array. RAID 1 is used to mirror identical copies of data between disk pairs. RAID 0 is used for simply striping data across the disks in your array.

Currently, the LPIC Level 2 Exams cover the software RAID tools mkraid, raidstop, and raidstart. These utilities use the /etc/raidtab configuration file.

The mkraid Tools

The mkraid tools are included in almost every major Linux distribution. /etc/raidtab is the default configuration file for the raid tools. It defines how RAID devices are configured on a system.

mkraid

Syntax
mkraid [-cvfu] /dev/md?
Description

This command sets up a set of block devices into a single RAID array. It looks in its configuration file for the md devices mentioned on the command line and initializes those arrays. mkraid works for all types of RAID arrays (RAID1, RAID4, RAID5, LINEAR and RAID0).

Options
-c, --configfile filename

Use filename as the configuration file (/etc/raidtab is used by default).

-f, --force

Initialize the constituent devices even if they appear to have data on them already.

-o, --upgrade

Upgrade older arrays to the current kernel's RAID version, without destroying data. Although the utility detects various pitfalls, such as mixed-up disks and inconsistent superblocks, this option should be used with care.

-V, --version

Display a short version message, then exit.

raidstart

Syntax
raidstart [options] raiddevice
Description

Activate an existing md device.

Options
-a, --all

Apply the command to all of the configurations specified in the configuration file.

-c, --configfile filename

Use filename as the configuration file (/etc/raidtab is used by default).

-h, --help

Display a short usage message, then exit.

-V, --version

Display a short version message, then exit.

raidstop

Syntax
raidstop [options] raiddevice
Description

Turn off an md device and unconfigure it.

Options
-a, --all

Apply the command to all of the configurations specified in the configuration file.

-c, --configfile filename

Use filename as the configuration file (/etc/raidtab is used by default).

-h, --help

Display a short usage message, then exit.

-V, --version

Display a short version message, then exit.

How to Create RAID 1 (Mirroring)

This procedure prepares one or more devices for redundancy. Firs,t set up the /etc/raidtab file to describe your configuration:

raiddev /dev/md0
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/sdb1
        raid-disk       0
        device          /dev/sdb2
        raid-disk       1

Now issue the following command to construct the mirror:

mkraid /dev/md0

Wait for whole process to finish. Check the estimated time (which depends on device sizes) and progression by looking inside of /proc/mdstat file. The process will happen online and the filesystem can be mounted.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset