dm-raid.txt 4.0 KB

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