dm-raid.txt 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. dm-raid
  2. -------
  3. The device-mapper RAID (dm-raid) target provides a bridge from DM to MD.
  4. It allows the MD RAID drivers to be accessed using a device-mapper
  5. interface.
  6. The target is named "raid" and it accepts the following parameters:
  7. <raid_type> <#raid_params> <raid_params> \
  8. <#raid_devs> <metadata_dev0> <dev0> [.. <metadata_devN> <devN>]
  9. <raid_type>:
  10. raid1 RAID1 mirroring
  11. raid4 RAID4 dedicated parity disk
  12. raid5_la RAID5 left asymmetric
  13. - rotating parity 0 with data continuation
  14. raid5_ra RAID5 right asymmetric
  15. - rotating parity N with data continuation
  16. raid5_ls RAID5 left symmetric
  17. - rotating parity 0 with data restart
  18. raid5_rs RAID5 right symmetric
  19. - rotating parity N with data restart
  20. raid6_zr RAID6 zero restart
  21. - rotating parity zero (left-to-right) with data restart
  22. raid6_nr RAID6 N restart
  23. - rotating parity N (right-to-left) with data restart
  24. raid6_nc RAID6 N continue
  25. - rotating parity N (right-to-left) with data continuation
  26. raid10 Various RAID10 inspired algorithms chosen by additional params
  27. - RAID10: Striped Mirrors (aka 'Striping on top of mirrors')
  28. - RAID1E: Integrated Adjacent Stripe Mirroring
  29. - RAID1E: Integrated Offset Stripe Mirroring
  30. - and other similar RAID10 variants
  31. Reference: Chapter 4 of
  32. http://www.snia.org/sites/default/files/SNIA_DDF_Technical_Position_v2.0.pdf
  33. <#raid_params>: The number of parameters that follow.
  34. <raid_params> consists of
  35. Mandatory parameters:
  36. <chunk_size>: Chunk size in sectors. This parameter is often known as
  37. "stripe size". It is the only mandatory parameter and
  38. is placed first.
  39. followed by optional parameters (in any order):
  40. [sync|nosync] Force or prevent RAID initialization.
  41. [rebuild <idx>] Rebuild drive number idx (first drive is 0).
  42. [daemon_sleep <ms>]
  43. Interval between runs of the bitmap daemon that
  44. clear bits. A longer interval means less bitmap I/O but
  45. resyncing after a failure is likely to take longer.
  46. [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization
  47. [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization
  48. [write_mostly <idx>] Drive index is write-mostly
  49. [max_write_behind <sectors>] See '-write-behind=' (man mdadm)
  50. [stripe_cache <sectors>] Stripe cache size (higher RAIDs only)
  51. [region_size <sectors>]
  52. The region_size multiplied by the number of regions is the
  53. logical size of the array. The bitmap records the device
  54. synchronisation state for each region.
  55. [raid10_copies <# copies>]
  56. [raid10_format <near|far|offset>]
  57. These two options are used to alter the default layout of
  58. a RAID10 configuration. The number of copies is can be
  59. specified, but the default is 2. There are also three
  60. variations to how the copies are laid down - the default
  61. is "near". Near copies are what most people think of with
  62. respect to mirroring. If these options are left unspecified,
  63. or 'raid10_copies 2' and/or 'raid10_format near' are given,
  64. then the layouts for 2, 3 and 4 devices are:
  65. 2 drives 3 drives 4 drives
  66. -------- ---------- --------------
  67. A1 A1 A1 A1 A2 A1 A1 A2 A2
  68. A2 A2 A2 A3 A3 A3 A3 A4 A4
  69. A3 A3 A4 A4 A5 A5 A5 A6 A6
  70. A4 A4 A5 A6 A6 A7 A7 A8 A8
  71. .. .. .. .. .. .. .. .. ..
  72. The 2-device layout is equivalent 2-way RAID1. The 4-device
  73. layout is what a traditional RAID10 would look like. The
  74. 3-device layout is what might be called a 'RAID1E - Integrated
  75. Adjacent Stripe Mirroring'.
  76. If 'raid10_copies 2' and 'raid10_format far', then the layouts
  77. for 2, 3 and 4 devices are:
  78. 2 drives 3 drives 4 drives
  79. -------- -------------- --------------------
  80. A1 A2 A1 A2 A3 A1 A2 A3 A4
  81. A3 A4 A4 A5 A6 A5 A6 A7 A8
  82. A5 A6 A7 A8 A9 A9 A10 A11 A12
  83. .. .. .. .. .. .. .. .. ..
  84. A2 A1 A3 A1 A2 A2 A1 A4 A3
  85. A4 A3 A6 A4 A5 A6 A5 A8 A7
  86. A6 A5 A9 A7 A8 A10 A9 A12 A11
  87. .. .. .. .. .. .. .. .. ..
  88. If 'raid10_copies 2' and 'raid10_format offset', then the
  89. layouts for 2, 3 and 4 devices are:
  90. 2 drives 3 drives 4 drives
  91. -------- ------------ -----------------
  92. A1 A2 A1 A2 A3 A1 A2 A3 A4
  93. A2 A1 A3 A1 A2 A2 A1 A4 A3
  94. A3 A4 A4 A5 A6 A5 A6 A7 A8
  95. A4 A3 A6 A4 A5 A6 A5 A8 A7
  96. A5 A6 A7 A8 A9 A9 A10 A11 A12
  97. A6 A5 A9 A7 A8 A10 A9 A12 A11
  98. .. .. .. .. .. .. .. .. ..
  99. Here we see layouts closely akin to 'RAID1E - Integrated
  100. Offset Stripe Mirroring'.
  101. <#raid_devs>: The number of devices composing the array.
  102. Each device consists of two entries. The first is the device
  103. containing the metadata (if any); the second is the one containing the
  104. data.
  105. If a drive has failed or is missing at creation time, a '-' can be
  106. given for both the metadata and data drives for a given position.
  107. Example tables
  108. --------------
  109. # RAID4 - 4 data drives, 1 parity (no metadata devices)
  110. # No metadata devices specified to hold superblock/bitmap info
  111. # Chunk size of 1MiB
  112. # (Lines separated for easy reading)
  113. 0 1960893648 raid \
  114. raid4 1 2048 \
  115. 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
  116. # RAID4 - 4 data drives, 1 parity (with metadata devices)
  117. # Chunk size of 1MiB, force RAID initialization,
  118. # min recovery rate at 20 kiB/sec/disk
  119. 0 1960893648 raid \
  120. raid4 4 2048 sync min_recovery_rate 20 \
  121. 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82
  122. 'dmsetup table' displays the table used to construct the mapping.
  123. The optional parameters are always printed in the order listed
  124. above with "sync" or "nosync" always output ahead of the other
  125. arguments, regardless of the order used when originally loading the table.
  126. Arguments that can be repeated are ordered by value.
  127. 'dmsetup status' yields information on the state and health of the
  128. array.
  129. The output is as follows:
  130. 1: <s> <l> raid \
  131. 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio>
  132. Line 1 is the standard output produced by device-mapper.
  133. Line 2 is produced by the raid target, and best explained by example:
  134. 0 1960893648 raid raid4 5 AAAAA 2/490221568
  135. Here we can see the RAID type is raid4, there are 5 devices - all of
  136. which are 'A'live, and the array is 2/490221568 complete with recovery.
  137. Faulty or missing devices are marked 'D'. Devices that are out-of-sync
  138. are marked 'a'.
  139. Version History
  140. ---------------
  141. 1.0.0 Initial version. Support for RAID 4/5/6
  142. 1.1.0 Added support for RAID 1
  143. 1.2.0 Handle creation of arrays that contain failed devices.
  144. 1.3.0 Added support for RAID 10
  145. 1.3.1 Allow device replacement/rebuild for RAID 10
  146. 1.3.2 Fix/improve redundancy checking for RAID10
  147. 1.4.0 Non-functional change. Removes arg from mapping function.
  148. 1.4.1 Add RAID10 "far" and "offset" algorithm support.