dm-raid.txt 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. raid4 RAID4 dedicated parity disk
  11. raid5_la RAID5 left asymmetric
  12. - rotating parity 0 with data continuation
  13. raid5_ra RAID5 right asymmetric
  14. - rotating parity N with data continuation
  15. raid5_ls RAID5 left symmetric
  16. - rotating parity 0 with data restart
  17. raid5_rs RAID5 right symmetric
  18. - rotating parity N with data restart
  19. raid6_zr RAID6 zero restart
  20. - rotating parity zero (left-to-right) with data restart
  21. raid6_nr RAID6 N restart
  22. - rotating parity N (right-to-left) with data restart
  23. raid6_nc RAID6 N continue
  24. - rotating parity N (right-to-left) with data continuation
  25. Refererence: Chapter 4 of
  26. http://www.snia.org/sites/default/files/SNIA_DDF_Technical_Position_v2.0.pdf
  27. <#raid_params>: The number of parameters that follow.
  28. <raid_params> consists of
  29. Mandatory parameters:
  30. <chunk_size>: Chunk size in sectors. This parameter is often known as
  31. "stripe size". It is the only mandatory parameter and
  32. is placed first.
  33. followed by optional parameters (in any order):
  34. [sync|nosync] Force or prevent RAID initialization.
  35. [rebuild <idx>] Rebuild drive number idx (first drive is 0).
  36. [daemon_sleep <ms>]
  37. Interval between runs of the bitmap daemon that
  38. clear bits. A longer interval means less bitmap I/O but
  39. resyncing after a failure is likely to take longer.
  40. [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization
  41. [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization
  42. [max_write_behind <sectors>] See '-write-behind=' (man mdadm)
  43. [stripe_cache <sectors>] Stripe cache size (higher RAIDs only)
  44. [region_size <sectors>]
  45. The region_size multiplied by the number of regions is the
  46. logical size of the array. The bitmap records the device
  47. synchronisation state for each region.
  48. <#raid_devs>: The number of devices composing the array.
  49. Each device consists of two entries. The first is the device
  50. containing the metadata (if any); the second is the one containing the
  51. data. Currently, separate metadata devices are not supported and '-'
  52. is required in place of the metadata device.
  53. If a drive has failed or is missing at creation time, a '-' can be
  54. given for both the metadata and data drives for a given position.
  55. Example tables
  56. --------------
  57. # RAID4 - 4 data drives, 1 parity
  58. # No metadata devices specified to hold superblock/bitmap info
  59. # Chunk size of 1MiB
  60. # (Lines separated for easy reading)
  61. 0 1960893648 raid \
  62. raid4 1 2048 \
  63. 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
  64. # RAID4 - 4 data drives, 1 parity (no metadata devices)
  65. # Chunk size of 1MiB, force RAID initialization,
  66. # min recovery rate at 20 kiB/sec/disk
  67. 0 1960893648 raid \
  68. raid4 4 2048 min_recovery_rate 20 sync\
  69. 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81
  70. 'dmsetup table' displays the table used to construct the mapping.
  71. The optional parameters will always be printed in the order listed
  72. above with "sync" or "nosync" always output ahead of the other
  73. arguments, regardless of the order used when originally loading the table.
  74. 'dmsetup status' yields information on the state and health of the
  75. array.
  76. The output is as follows:
  77. 1: <s> <l> raid \
  78. 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio>
  79. Line 1 is the standard output produced by device-mapper.
  80. Line 2 is produced by the raid target, and best explained by example:
  81. 0 1960893648 raid raid4 5 AAAAA 2/490221568
  82. Here we can see the RAID type is raid4, there are 5 devices - all of
  83. which are 'A'live, and the array is 2/490221568 complete with recovery.
  84. Faulty or missing devices are marked 'D'. Devices that are out-of-sync
  85. are marked 'a'.