Managing RAID on Linux - Derek Vadala [67]
Options
-c, --configfile filename
Specifies the use of a configuration file other than the default /etc/raidtab.
-f, --force, --really-force, -R
Forces the initialization, even if data or filesystems are detected on any of the block devices to be included in the array. This is a fail-safe to prevent uninitiated users from accidentally destroying their data. The --really- force or -R flag is undocumented in the command help and manual pages. When the -f or --force flags are used, mkraid will display an additional warning and request that the command be retyped with the --really-force flag.
-h, --help
Displays some helpful information about the command.
-u, --upgrade
Upgrades an old RAID to the current version of the kernel's RAID subsystem. This option brings arrays with a RAID superblock up to the current md driver version. It does not convert older arrays without superblocks. It is advisable to back up data before attempting this operation.
-V, --version
Displays the command's version.
Example usage
The following creates an array at /dev/md0, as described in /etc/raidtab:
# mkraid /dev/md0
Using alternate configuration files is extremely useful if you are experimenting with many different types of arrays. That way, you can keep copies of array configurations that have been successful, copying and combining them into /etc/raidtab when you're ready to go into production. The force flag is also useful when experimenting. The following creates, by force, the array /dev/md1 specified in the alternate configuration file /home/derek/myraidtab:
# mkraid --really-force -c /home/derek/myraidtab /dev/md1
The following upgrades an array to the kernel's current version:
# raidstop /dev/md0
# mkraid -u /dev/md0
Name
raidhotadd
Synopsis
raidhotadd mdevice memberdevice
raidhotadd inserts a new disk into a running array. After a failed drive has been removed using raidhotadd, you can use this command to add a replacement drive.
When a new drive is introduced into an active array, reconstruction commences. Therefore, it's a wise idea to add a new drive when you are certain that the recovery process will not impact users. There may, of course, be times when waiting is not an option. You can also fine-tune the speed at which recovery occurs in order to minimize the impact on the system. Refer to the /proc/sys/dev/raid section, earlier in this chapter, for details on how to throttle the recovery process.
Options
raidhotadd has no command-line options. It takes an md device and a member disk as its only arguments.
Example usage
The following adds /dev/sdc1 to the array /dev/md0:
# raidhotadd /dev/md0 /dev/sdc1
Name
raidhotgenerateerror
Synopsis
raidhotgenerateerror mddevice memberdevice
raidhotgenerateerror should not be used to administer arrays. I mention it here only because it has caused some confusion among Linux RAID users, as described near the beginning of the "raidtools" section.
Name
raidhotremove
Synopsis
raidhotremove mddevice memberdevice
raidhotremove removes a failed disk or a spare disk from an array. This is useful, in combination with raidhotadd, for replacing a failed disk with a new, working disk. You could also use raidhotremove to remove a spare disk from an array so that it can be used in another array, which is helpful when only one spare disk is available on a system with multiple arrays. In that case, you could use raidhotremove to pull the spare disk from a fully functional array and insert it into an array to make up for a failed disk.
There might be some instances when a disk is generating errors at the bus level, but hasn't been marked as failed by the md driver. In that case, first use raidsetfaulty