Online Book Reader

Home Category

Managing RAID on Linux - Derek Vadala [42]

By Root 1360 0
/etc/raidtab that describes a RAID-0 with two ATA component disks:

raiddev /dev/md0

raid-level 0

persistent-superblock 1

chunk-size 64

nr-raid-disks 2

nr-spare-disks 0

device /dev/hda1

raid-disk 0

device /dev/hdb1

raid-disk 1

Each array begins with a raiddev entry, followed by a list of array properties and an entry for each array member. A valid entry in /etc/raidtab must contain at least a defined raid-level, a chunk-size, the total number of raid disks (nr-raid-disks) and two device/raid-disk pairs. chunk-size is a bit counterintuitive because it applies only to arrays that support disk striping (RAID-0, RAID-4, and RAID-5), yet it is required for any array you define in /etc/raidtab. That's because the utilities in the raidtools package (mkraid, most notably) check for a chunk-size even if the defined RAID level doesn't support one. So when you work with linear mode or RAID-1, for example, you must provide a chunk-size, even though it's technically only a placeholder.

There are no global options in /etc/raidtab. Each section, or stanza, applies to the last parsed raiddev entry. Once an array is defined, it may be included as a member disk in a subsequent array section. This allows you to combine multiple arrays into a hybrid array (as in RAID-10, for example).

Chapter 4 provides details about each /etc/raidtab parameter.

raidtools-0.42

It's unlikely that you will be able to locate a package file for this outdated version of raidtools. So, in most cases, you will be stuck compiling the tools yourself. Download version 0.42 of the raidtools (ftp://ftp.kernel.org/pub/linux/daemons/raid/raidtools-pre3-0.42.tar.gz) and unpack it.

One important caveat when working with this version is that it requires a patched kernel to compile. By default, the configure command assumes that your kernel is in /usr/src/linux, but you can change that by using the --with-linux parameter.

# cd /usr/src/raidtools-0.42

# ./configure --with-linux=/usr/src/linux-2.0.37

# make

# make install

Installation will leave you with an older version of mkraid, as well as several deprecated utilities that are used to start (mdrun), stop (mdstop), and manage (mdcreate, ckraid) arrays. Manual pages are also installed by default.

Debian users can install version 0.42 of raidtools using apt-get:

# apt-get install raidtools

The rest of this chapter covers the current version of raidtools and the md driver. However, if you are working with legacy arrays, then you will have to use the 0.42 version of raidtools or mdadm to manage them. I strongly recommend that you upgrade old arrays whenever possible.

mdadm

Over the years, many users have become quite frustrated by the problems involved in using raidtools and /etc/raidtab to manage software RAID. On small systems, the problems presented by raidtools are tolerable. But on large systems with multiple arrays, each with the potential for dozens of member disks, managing /etc/raidtab can become daunting. mdadm provides a slightly different approach from raidtools. The idea behind mdadm is that the kernel, as well as administrators, should be able to manage arrays without resorting to a complicated, structured configuration file.

mdadm uses a Universally Unique ID (UUID) to identify each array and member disk. A UUID is a 128-bit number that is guaranteed to be reasonably unique on both the local system and across other systems. It is randomly generated, using system hardware and timestamps as part of its seed. mdadm uses the UUIDs found in the array superblock to scan member disks, determining which array they belong to and what the array properties are. Many programs use UUIDs to tag devices uniqely. In fact, kernel RAID autodetection uses these UUIDs, too. See the uuidgen and libuuid manual pages for more information.

mdadm provides all the same functions that raidtools provides, in addition to some new features. The only disadvantage of mdadm is that it's new. Neil Brown began working on mdadm in June of 2001, and it has undergone only a few revisions. mdadm can also manage legacy

Return Main Page Previous Page Next Page

®Online Book Reader