Online Book Reader

Home Category

Managing RAID on Linux - Derek Vadala [70]

By Root 1456 0
-c /home/derek/example-raid0

The following starts only the array /dev/md2, as described in /etc/raidtab:

# raidstart /dev/md2

The following starts /dev/md2, as defined in /home/derek/example-raid0:

# raidstart -c /home/derek/example-raid0 /dev/md2

raidstart can also be included in system initialization scripts. This is quite useful in cases in which you don't want the kernel to automatically detect and activate software arrays. Perhaps you would like to defer array startup until after some other scripts have run, or maybe you are not using MS-DOS partitions and simply can't autostart. Simply add the raidstart command to the appropriate system initialization files. Many distributions, in fact, provide an initialization script that automatically parses /etc/raidtab and activates arrays that it finds there. /etc/rc.d/rc.sysinit on Red Hat performs this function, for example.

* * *

Warning

I want to point out that many users report that raidstart is unreliable, especially in cases when the first component drive listed in /etc/raidtab has failed or when major or minor numbers for component disks have changed. For that reason, using kernel autodetection, or even mdadm, are recommended alternatives.

* * *

Name

raidstop

Synopsis

raidstop [options] mddevice

raidstop is the counterpart of raidstart and is useful for the same reasons. Since member disks can be allocated to only one array at a time, arrays must be deactivated by using raidstop before their member disks can become available to use in new arrays.

Options

-a, --all

Applies command to all devices found in /etc/raidtab. You will not need to specify an mddevice.

-c, --configfile filename

Specifies the use of a configuration file other than the default /etc/raidtab.

-h, --help

Displays configuration flags and exits.

-V, --version

Displays the command version and exit.

Example usage

The following stops all devices found in /etc/raidtab:

# raidstop -a

The following stops all arrays defined in /home/derek/example-raid0:

# raidstop -a -c /home/derek/example-raid0

The following stops /dev/md2, as defined in /home/derek/example-raid0:

# raidstart -c /home/derek/example-raid0 /dev/md2

The following stops only the array /dev/md2, as described in /etc/raidtab:

# raidstart /dev/md2

mdadm

mdadm provides a convenient, single-command interface for managing software arrays under Linux. While mdadm is fully functional without the use of a configuration file, it does support a configuration file, /etc/mdadm.conf, which is more concise and straightforward than /etc/raidtab. With mdadm, the configuration file is created after arrays, as a way to preserve information for arrays and member disks, so that they can be reactivated later. mdadm can be used as a total replacement for raidtools.

Name

mdadm

Synopsis

mdadm [mode] mddevice [options] memberdevices

mdadm has several modes of operation: Create, Build, Assemble, and Monitor. Each of these modes has its own command-line switch. In addition to these modes, there are many management features that operate independently. These standalone features are grouped into Manage or Miscellaneous mode. Most mdadm options have a long and a short form, although a few options have only a long form, to safeguard against using them accidentally. You can use whichever form you prefer.

General options for mdadm

-h, --help

Displays general help for mdadm. The --help option can also be combined with other options to display topic-specific help (for example, mdadm --create -help).

-V, --version

Displays the mdadm version.

-v, --verbose

Increases verbosity. This option can be combined with other options to increase the amount of information that mdadm displays.

Name

Create and Build modes

Synopsis

mdadm --create mddevice [options] memberdevicesmdadm --build mddevice [options] memberdevices

The Create and Build modes are similar in that they are both used to create new arrays. However, Build mode is used only for backward compatibility, to create legacy

Return Main Page Previous Page Next Page

®Online Book Reader