diff options
Diffstat (limited to 'Documentation/device-mapper/dm-raid.txt')
-rw-r--r-- | Documentation/device-mapper/dm-raid.txt | 138 |
1 files changed, 88 insertions, 50 deletions
diff --git a/Documentation/device-mapper/dm-raid.txt b/Documentation/device-mapper/dm-raid.txt index 33b6b7071ac8..2a8c11331d2d 100644 --- a/Documentation/device-mapper/dm-raid.txt +++ b/Documentation/device-mapper/dm-raid.txt | |||
@@ -1,70 +1,108 @@ | |||
1 | Device-mapper RAID (dm-raid) is a bridge from DM to MD. It | 1 | dm-raid |
2 | provides a way to use device-mapper interfaces to access the MD RAID | 2 | ------- |
3 | drivers. | ||
4 | 3 | ||
5 | As with all device-mapper targets, the nominal public interfaces are the | 4 | The device-mapper RAID (dm-raid) target provides a bridge from DM to MD. |
6 | constructor (CTR) tables and the status outputs (both STATUSTYPE_INFO | 5 | It allows the MD RAID drivers to be accessed using a device-mapper |
7 | and STATUSTYPE_TABLE). The CTR table looks like the following: | 6 | interface. |
8 | 7 | ||
9 | 1: <s> <l> raid \ | 8 | The target is named "raid" and it accepts the following parameters: |
10 | 2: <raid_type> <#raid_params> <raid_params> \ | 9 | |
11 | 3: <#raid_devs> <meta_dev1> <dev1> .. <meta_devN> <devN> | 10 | <raid_type> <#raid_params> <raid_params> \ |
12 | 11 | <#raid_devs> <metadata_dev0> <dev0> [.. <metadata_devN> <devN>] | |
13 | Line 1 contains the standard first three arguments to any device-mapper | 12 | |
14 | target - the start, length, and target type fields. The target type in | 13 | <raid_type>: |
15 | this case is "raid". | 14 | raid1 RAID1 mirroring |
16 | 15 | raid4 RAID4 dedicated parity disk | |
17 | Line 2 contains the arguments that define the particular raid | 16 | raid5_la RAID5 left asymmetric |
18 | type/personality/level, the required arguments for that raid type, and | 17 | - rotating parity 0 with data continuation |
19 | any optional arguments. Possible raid types include: raid4, raid5_la, | 18 | raid5_ra RAID5 right asymmetric |
20 | raid5_ls, raid5_rs, raid6_zr, raid6_nr, and raid6_nc. (raid1 is | 19 | - rotating parity N with data continuation |
21 | planned for the future.) The list of required and optional parameters | 20 | raid5_ls RAID5 left symmetric |
22 | is the same for all the current raid types. The required parameters are | 21 | - rotating parity 0 with data restart |
23 | positional, while the optional parameters are given as key/value pairs. | 22 | raid5_rs RAID5 right symmetric |
24 | The possible parameters are as follows: | 23 | - rotating parity N with data restart |
25 | <chunk_size> Chunk size in sectors. | 24 | raid6_zr RAID6 zero restart |
26 | [[no]sync] Force/Prevent RAID initialization | 25 | - rotating parity zero (left-to-right) with data restart |
27 | [rebuild <idx>] Rebuild the drive indicated by the index | 26 | raid6_nr RAID6 N restart |
28 | [daemon_sleep <ms>] Time between bitmap daemon work to clear bits | 27 | - rotating parity N (right-to-left) with data restart |
29 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 28 | raid6_nc RAID6 N continue |
30 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 29 | - rotating parity N (right-to-left) with data continuation |
31 | [max_write_behind <sectors>] See '-write-behind=' (man mdadm) | 30 | |
32 | [stripe_cache <sectors>] Stripe cache size for higher RAIDs | 31 | Refererence: Chapter 4 of |
33 | 32 | http://www.snia.org/sites/default/files/SNIA_DDF_Technical_Position_v2.0.pdf | |
34 | Line 3 contains the list of devices that compose the array in | 33 | |
35 | metadata/data device pairs. If the metadata is stored separately, a '-' | 34 | <#raid_params>: The number of parameters that follow. |
36 | is given for the metadata device position. If a drive has failed or is | 35 | |
37 | missing at creation time, a '-' can be given for both the metadata and | 36 | <raid_params> consists of |
38 | data drives for a given position. | 37 | Mandatory parameters: |
39 | 38 | <chunk_size>: Chunk size in sectors. This parameter is often known as | |
40 | NB. Currently all metadata devices must be specified as '-'. | 39 | "stripe size". It is the only mandatory parameter and |
41 | 40 | is placed first. | |
42 | Examples: | 41 | |
43 | # RAID4 - 4 data drives, 1 parity | 42 | followed by optional parameters (in any order): |
43 | [sync|nosync] Force or prevent RAID initialization. | ||
44 | |||
45 | [rebuild <idx>] Rebuild drive number idx (first drive is 0). | ||
46 | |||
47 | [daemon_sleep <ms>] | ||
48 | Interval between runs of the bitmap daemon that | ||
49 | clear bits. A longer interval means less bitmap I/O but | ||
50 | resyncing after a failure is likely to take longer. | ||
51 | |||
52 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization | ||
53 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization | ||
54 | [write_mostly <idx>] Drive index is write-mostly | ||
55 | [max_write_behind <sectors>] See '-write-behind=' (man mdadm) | ||
56 | [stripe_cache <sectors>] Stripe cache size (higher RAIDs only) | ||
57 | [region_size <sectors>] | ||
58 | The region_size multiplied by the number of regions is the | ||
59 | logical size of the array. The bitmap records the device | ||
60 | synchronisation state for each region. | ||
61 | |||
62 | <#raid_devs>: The number of devices composing the array. | ||
63 | Each device consists of two entries. The first is the device | ||
64 | containing the metadata (if any); the second is the one containing the | ||
65 | data. | ||
66 | |||
67 | If a drive has failed or is missing at creation time, a '-' can be | ||
68 | given for both the metadata and data drives for a given position. | ||
69 | |||
70 | |||
71 | Example tables | ||
72 | -------------- | ||
73 | # RAID4 - 4 data drives, 1 parity (no metadata devices) | ||
44 | # No metadata devices specified to hold superblock/bitmap info | 74 | # No metadata devices specified to hold superblock/bitmap info |
45 | # Chunk size of 1MiB | 75 | # Chunk size of 1MiB |
46 | # (Lines separated for easy reading) | 76 | # (Lines separated for easy reading) |
77 | |||
47 | 0 1960893648 raid \ | 78 | 0 1960893648 raid \ |
48 | raid4 1 2048 \ | 79 | raid4 1 2048 \ |
49 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 | 80 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 |
50 | 81 | ||
51 | # RAID4 - 4 data drives, 1 parity (no metadata devices) | 82 | # RAID4 - 4 data drives, 1 parity (with metadata devices) |
52 | # Chunk size of 1MiB, force RAID initialization, | 83 | # Chunk size of 1MiB, force RAID initialization, |
53 | # min recovery rate at 20 kiB/sec/disk | 84 | # min recovery rate at 20 kiB/sec/disk |
85 | |||
54 | 0 1960893648 raid \ | 86 | 0 1960893648 raid \ |
55 | raid4 4 2048 min_recovery_rate 20 sync\ | 87 | raid4 4 2048 sync min_recovery_rate 20 \ |
56 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 | 88 | 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82 |
57 | 89 | ||
58 | Performing a 'dmsetup table' should display the CTR table used to | 90 | 'dmsetup table' displays the table used to construct the mapping. |
59 | construct the mapping (with possible reordering of optional | 91 | The optional parameters are always printed in the order listed |
60 | parameters). | 92 | above with "sync" or "nosync" always output ahead of the other |
93 | arguments, regardless of the order used when originally loading the table. | ||
94 | Arguments that can be repeated are ordered by value. | ||
61 | 95 | ||
62 | Performing a 'dmsetup status' will yield information on the state and | 96 | 'dmsetup status' yields information on the state and health of the |
63 | health of the array. The output is as follows: | 97 | array. |
98 | The output is as follows: | ||
64 | 1: <s> <l> raid \ | 99 | 1: <s> <l> raid \ |
65 | 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio> | 100 | 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio> |
66 | 101 | ||
67 | Line 1 is standard DM output. Line 2 is best shown by example: | 102 | Line 1 is the standard output produced by device-mapper. |
103 | Line 2 is produced by the raid target, and best explained by example: | ||
68 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 | 104 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 |
69 | Here we can see the RAID type is raid4, there are 5 devices - all of | 105 | Here we can see the RAID type is raid4, there are 5 devices - all of |
70 | which are 'A'live, and the array is 2/490221568 complete with recovery. | 106 | which are 'A'live, and the array is 2/490221568 complete with recovery. |
107 | Faulty or missing devices are marked 'D'. Devices that are out-of-sync | ||
108 | are marked 'a'. | ||