dm-raid.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. - and other similar RAID10 variants
  30. Reference: Chapter 4 of
  31. http://www.snia.org/sites/default/files/SNIA_DDF_Technical_Position_v2.0.pdf
  32. <#raid_params>: The number of parameters that follow.
  33. <raid_params> consists of
  34. Mandatory parameters:
  35. <chunk_size>: Chunk size in sectors. This parameter is often known as
  36. "stripe size". It is the only mandatory parameter and
  37. is placed first.
  38. followed by optional parameters (in any order):
  39. [sync|nosync] Force or prevent RAID initialization.
  40. [rebuild <idx>] Rebuild drive number idx (first drive is 0).
  41. [daemon_sleep <ms>]
  42. Interval between runs of the bitmap daemon that
  43. clear bits. A longer interval means less bitmap I/O but
  44. resyncing after a failure is likely to take longer.
  45. [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization
  46. [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization
  47. [write_mostly <idx>] Drive index is write-mostly
  48. [max_write_behind <sectors>] See '-write-behind=' (man mdadm)
  49. [stripe_cache <sectors>] Stripe cache size (higher RAIDs only)
  50. [region_size <sectors>]
  51. The region_size multiplied by the number of regions is the
  52. logical size of the array. The bitmap records the device
  53. synchronisation state for each region.
  54. [raid10_copies <# copies>]
  55. [raid10_format near]
  56. These two options are used to alter the default layout of
  57. a RAID10 configuration. The number of copies is can be
  58. specified, but the default is 2. There are other variations
  59. to how the copies are laid down - the default and only current
  60. option is "near". Near copies are what most people think of
  61. with respect to mirroring. If these options are left
  62. unspecified, or 'raid10_copies 2' and/or 'raid10_format near'
  63. are given, then the layouts for 2, 3 and 4 devices are:
  64. 2 drives 3 drives 4 drives
  65. -------- ---------- --------------
  66. A1 A1 A1 A1 A2 A1 A1 A2 A2
  67. A2 A2 A2 A3 A3 A3 A3 A4 A4
  68. A3 A3 A4 A4 A5 A5 A5 A6 A6
  69. A4 A4 A5 A6 A6 A7 A7 A8 A8
  70. .. .. .. .. .. .. .. .. ..
  71. The 2-device layout is equivalent 2-way RAID1. The 4-device
  72. layout is what a traditional RAID10 would look like. The
  73. 3-device layout is what might be called a 'RAID1E - Integrated
  74. Adjacent Stripe Mirroring'.
  75. <#raid_devs>: The number of devices composing the array.
  76. Each device consists of two entries. The first is the device
  77. containing the metadata (if any); the second is the one containing the
  78. data.
  79. If a drive has failed or is missing at creation time, a '-' can be
  80. given for both the metadata and data drives for a given position.
  81. Example tables
  82. --------------
  83. # RAID4 - 4 data drives, 1 parity (no metadata devices)
  84. # No metadata devices specified to hold superblock/bitmap info
  85. # Chunk size of 1MiB
  86. # (Lines separated for easy reading)
  87. 0 1960893648 raid \
  88. raid4 1 2048 \
  89. 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
  90. # RAID4 - 4 data drives, 1 parity (with metadata devices)
  91. # Chunk size of 1MiB, force RAID initialization,
  92. # min recovery rate at 20 kiB/sec/disk
  93. 0 1960893648 raid \
  94. raid4 4 2048 sync min_recovery_rate 20 \
  95. 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82
  96. 'dmsetup table' displays the table used to construct the mapping.
  97. The optional parameters are always printed in the order listed
  98. above with "sync" or "nosync" always output ahead of the other
  99. arguments, regardless of the order used when originally loading the table.
  100. Arguments that can be repeated are ordered by value.
  101. 'dmsetup status' yields information on the state and health of the
  102. array.
  103. The output is as follows:
  104. 1: <s> <l> raid \
  105. 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio>
  106. Line 1 is the standard output produced by device-mapper.
  107. Line 2 is produced by the raid target, and best explained by example:
  108. 0 1960893648 raid raid4 5 AAAAA 2/490221568
  109. Here we can see the RAID type is raid4, there are 5 devices - all of
  110. which are 'A'live, and the array is 2/490221568 complete with recovery.
  111. Faulty or missing devices are marked 'D'. Devices that are out-of-sync
  112. are marked 'a'.
  113. Version History
  114. ---------------
  115. 1.0.0 Initial version. Support for RAID 4/5/6
  116. 1.1.0 Added support for RAID 1
  117. 1.2.0 Handle creation of arrays that contain failed devices.
  118. 1.3.0 Added support for RAID 10
  119. 1.3.1 Allow device replacement/rebuild for RAID 10