blob: a7d1c4abc92793e79f5cadae0cb9ad3ae368d3aa [file] [log] [blame]
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +01001dm-raid
2-------
NeilBrown9d09e662011-01-13 20:00:02 +00003
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +01004The device-mapper RAID (dm-raid) target provides a bridge from DM to MD.
5It allows the MD RAID drivers to be accessed using a device-mapper
6interface.
NeilBrown9d09e662011-01-13 20:00:02 +00007
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +01008The target is named "raid" and it accepts the following parameters:
NeilBrown9d09e662011-01-13 20:00:02 +00009
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010010 <raid_type> <#raid_params> <raid_params> \
11 <#raid_devs> <metadata_dev0> <dev0> [.. <metadata_devN> <devN>]
NeilBrown9d09e662011-01-13 20:00:02 +000012
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010013<raid_type>:
14 raid4 RAID4 dedicated parity disk
15 raid5_la RAID5 left asymmetric
16 - rotating parity 0 with data continuation
17 raid5_ra RAID5 right asymmetric
18 - rotating parity N with data continuation
19 raid5_ls RAID5 left symmetric
20 - rotating parity 0 with data restart
21 raid5_rs RAID5 right symmetric
22 - rotating parity N with data restart
23 raid6_zr RAID6 zero restart
24 - rotating parity zero (left-to-right) with data restart
25 raid6_nr RAID6 N restart
26 - rotating parity N (right-to-left) with data restart
27 raid6_nc RAID6 N continue
28 - rotating parity N (right-to-left) with data continuation
NeilBrown9d09e662011-01-13 20:00:02 +000029
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010030 Refererence: Chapter 4 of
31 http://www.snia.org/sites/default/files/SNIA_DDF_Technical_Position_v2.0.pdf
NeilBrown9d09e662011-01-13 20:00:02 +000032
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010033<#raid_params>: The number of parameters that follow.
NeilBrown9d09e662011-01-13 20:00:02 +000034
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010035<raid_params> consists of
36 Mandatory parameters:
37 <chunk_size>: Chunk size in sectors. This parameter is often known as
38 "stripe size". It is the only mandatory parameter and
39 is placed first.
40
41 followed by optional parameters (in any order):
42 [sync|nosync] Force or prevent RAID initialization.
43
44 [rebuild <idx>] Rebuild drive number idx (first drive is 0).
45
46 [daemon_sleep <ms>]
47 Interval between runs of the bitmap daemon that
48 clear bits. A longer interval means less bitmap I/O but
49 resyncing after a failure is likely to take longer.
50
51 [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization
52 [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization
Jonathan Brassow46bed2b2011-08-02 12:32:07 +010053 [write_mostly <idx>] Drive index is write-mostly
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010054 [max_write_behind <sectors>] See '-write-behind=' (man mdadm)
55 [stripe_cache <sectors>] Stripe cache size (higher RAIDs only)
Jonathan Brassowc1084562011-08-02 12:32:07 +010056 [region_size <sectors>]
57 The region_size multiplied by the number of regions is the
58 logical size of the array. The bitmap records the device
59 synchronisation state for each region.
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010060
61<#raid_devs>: The number of devices composing the array.
62 Each device consists of two entries. The first is the device
63 containing the metadata (if any); the second is the one containing the
64 data. Currently, separate metadata devices are not supported and '-'
65 is required in place of the metadata device.
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
71Example tables
72--------------
NeilBrown9d09e662011-01-13 20:00:02 +000073# RAID4 - 4 data drives, 1 parity
74# No metadata devices specified to hold superblock/bitmap info
75# Chunk size of 1MiB
76# (Lines separated for easy reading)
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010077
NeilBrown9d09e662011-01-13 20:00:02 +0000780 1960893648 raid \
79 raid4 1 2048 \
80 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
81
82# RAID4 - 4 data drives, 1 parity (no metadata devices)
83# Chunk size of 1MiB, force RAID initialization,
84# min recovery rate at 20 kiB/sec/disk
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010085
NeilBrown9d09e662011-01-13 20:00:02 +0000860 1960893648 raid \
87 raid4 4 2048 min_recovery_rate 20 sync\
88 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
89
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010090'dmsetup table' displays the table used to construct the mapping.
Jonathan Brassow46bed2b2011-08-02 12:32:07 +010091The optional parameters are always printed in the order listed
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010092above with "sync" or "nosync" always output ahead of the other
93arguments, regardless of the order used when originally loading the table.
Jonathan Brassow46bed2b2011-08-02 12:32:07 +010094Arguments that can be repeated are ordered by value.
NeilBrown9d09e662011-01-13 20:00:02 +000095
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +010096'dmsetup status' yields information on the state and health of the
97array.
98The output is as follows:
NeilBrown9d09e662011-01-13 20:00:02 +0000991: <s> <l> raid \
1002: <raid_type> <#devices> <1 health char for each dev> <resync_ratio>
101
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +0100102Line 1 is the standard output produced by device-mapper.
103Line 2 is produced by the raid target, and best explained by example:
NeilBrown9d09e662011-01-13 20:00:02 +0000104 0 1960893648 raid raid4 5 AAAAA 2/490221568
105Here we can see the RAID type is raid4, there are 5 devices - all of
106which are 'A'live, and the array is 2/490221568 complete with recovery.
Jonathan Brassowc0a2fa12011-08-02 12:32:06 +0100107Faulty or missing devices are marked 'D'. Devices that are out-of-sync
108are marked 'a'.