diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-03 02:49:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-03 02:49:21 -0400 |
commit | f3406816bb2486fc44558bec77179cd9bcbd4450 (patch) | |
tree | 718db1ef45e55314b5e7290f77e70e6328d855a4 /Documentation | |
parent | 4400478ba3d939b680810aa004f1e954b4f8ba16 (diff) | |
parent | ed8b752bccf2560e305e25125721d2f0ac759e88 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: (34 commits)
dm table: set flush capability based on underlying devices
dm crypt: optionally support discard requests
dm raid: add md raid1 support
dm raid: support metadata devices
dm raid: add write_mostly parameter
dm raid: add region_size parameter
dm raid: improve table parameters documentation
dm ioctl: forbid multiple device specifiers
dm ioctl: introduce __get_dev_cell
dm ioctl: fill in device parameters in more ioctls
dm flakey: add corrupt_bio_byte feature
dm flakey: add drop_writes
dm flakey: support feature args
dm flakey: use dm_target_offset and support discards
dm table: share target argument parsing functions
dm snapshot: skip reading origin when overwriting complete chunk
dm: ignore merge_bvec for snapshots when safe
dm table: clean dm_get_device and move exports
dm raid: tidy includes
dm ioctl: prevent empty message
...
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/device-mapper/dm-crypt.txt | 21 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-flakey.txt | 48 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-raid.txt | 138 |
3 files changed, 150 insertions, 57 deletions
diff --git a/Documentation/device-mapper/dm-crypt.txt b/Documentation/device-mapper/dm-crypt.txt index 6b5c42dbbe84..2c656ae43ba7 100644 --- a/Documentation/device-mapper/dm-crypt.txt +++ b/Documentation/device-mapper/dm-crypt.txt | |||
@@ -4,7 +4,8 @@ dm-crypt | |||
4 | Device-Mapper's "crypt" target provides transparent encryption of block devices | 4 | Device-Mapper's "crypt" target provides transparent encryption of block devices |
5 | using the kernel crypto API. | 5 | using the kernel crypto API. |
6 | 6 | ||
7 | Parameters: <cipher> <key> <iv_offset> <device path> <offset> | 7 | Parameters: <cipher> <key> <iv_offset> <device path> \ |
8 | <offset> [<#opt_params> <opt_params>] | ||
8 | 9 | ||
9 | <cipher> | 10 | <cipher> |
10 | Encryption cipher and an optional IV generation mode. | 11 | Encryption cipher and an optional IV generation mode. |
@@ -37,6 +38,24 @@ Parameters: <cipher> <key> <iv_offset> <device path> <offset> | |||
37 | <offset> | 38 | <offset> |
38 | Starting sector within the device where the encrypted data begins. | 39 | Starting sector within the device where the encrypted data begins. |
39 | 40 | ||
41 | <#opt_params> | ||
42 | Number of optional parameters. If there are no optional parameters, | ||
43 | the optional paramaters section can be skipped or #opt_params can be zero. | ||
44 | Otherwise #opt_params is the number of following arguments. | ||
45 | |||
46 | Example of optional parameters section: | ||
47 | 1 allow_discards | ||
48 | |||
49 | allow_discards | ||
50 | Block discard requests (a.k.a. TRIM) are passed through the crypt device. | ||
51 | The default is to ignore discard requests. | ||
52 | |||
53 | WARNING: Assess the specific security risks carefully before enabling this | ||
54 | option. For example, allowing discards on encrypted devices may lead to | ||
55 | the leak of information about the ciphertext device (filesystem type, | ||
56 | used space etc.) if the discarded blocks can be located easily on the | ||
57 | device later. | ||
58 | |||
40 | Example scripts | 59 | Example scripts |
41 | =============== | 60 | =============== |
42 | LUKS (Linux Unified Key Setup) is now the preferred way to set up disk | 61 | LUKS (Linux Unified Key Setup) is now the preferred way to set up disk |
diff --git a/Documentation/device-mapper/dm-flakey.txt b/Documentation/device-mapper/dm-flakey.txt index c8efdfd19a65..6ff5c2327227 100644 --- a/Documentation/device-mapper/dm-flakey.txt +++ b/Documentation/device-mapper/dm-flakey.txt | |||
@@ -1,17 +1,53 @@ | |||
1 | dm-flakey | 1 | dm-flakey |
2 | ========= | 2 | ========= |
3 | 3 | ||
4 | This target is the same as the linear target except that it returns I/O | 4 | This target is the same as the linear target except that it exhibits |
5 | errors periodically. It's been found useful in simulating failing | 5 | unreliable behaviour periodically. It's been found useful in simulating |
6 | devices for testing purposes. | 6 | failing devices for testing purposes. |
7 | 7 | ||
8 | Starting from the time the table is loaded, the device is available for | 8 | Starting from the time the table is loaded, the device is available for |
9 | <up interval> seconds, then returns errors for <down interval> seconds, | 9 | <up interval> seconds, then exhibits unreliable behaviour for <down |
10 | and then this cycle repeats. | 10 | interval> seconds, and then this cycle repeats. |
11 | 11 | ||
12 | Parameters: <dev path> <offset> <up interval> <down interval> | 12 | Also, consider using this in combination with the dm-delay target too, |
13 | which can delay reads and writes and/or send them to different | ||
14 | underlying devices. | ||
15 | |||
16 | Table parameters | ||
17 | ---------------- | ||
18 | <dev path> <offset> <up interval> <down interval> \ | ||
19 | [<num_features> [<feature arguments>]] | ||
20 | |||
21 | Mandatory parameters: | ||
13 | <dev path>: Full pathname to the underlying block-device, or a | 22 | <dev path>: Full pathname to the underlying block-device, or a |
14 | "major:minor" device-number. | 23 | "major:minor" device-number. |
15 | <offset>: Starting sector within the device. | 24 | <offset>: Starting sector within the device. |
16 | <up interval>: Number of seconds device is available. | 25 | <up interval>: Number of seconds device is available. |
17 | <down interval>: Number of seconds device returns errors. | 26 | <down interval>: Number of seconds device returns errors. |
27 | |||
28 | Optional feature parameters: | ||
29 | If no feature parameters are present, during the periods of | ||
30 | unreliability, all I/O returns errors. | ||
31 | |||
32 | drop_writes: | ||
33 | All write I/O is silently ignored. | ||
34 | Read I/O is handled correctly. | ||
35 | |||
36 | corrupt_bio_byte <Nth_byte> <direction> <value> <flags>: | ||
37 | During <down interval>, replace <Nth_byte> of the data of | ||
38 | each matching bio with <value>. | ||
39 | |||
40 | <Nth_byte>: The offset of the byte to replace. | ||
41 | Counting starts at 1, to replace the first byte. | ||
42 | <direction>: Either 'r' to corrupt reads or 'w' to corrupt writes. | ||
43 | 'w' is incompatible with drop_writes. | ||
44 | <value>: The value (from 0-255) to write. | ||
45 | <flags>: Perform the replacement only if bio->bi_rw has all the | ||
46 | selected flags set. | ||
47 | |||
48 | Examples: | ||
49 | corrupt_bio_byte 32 r 1 0 | ||
50 | - replaces the 32nd byte of READ bios with the value 1 | ||
51 | |||
52 | corrupt_bio_byte 224 w 0 32 | ||
53 | - replaces the 224th byte of REQ_META (=32) bios with the value 0 | ||
diff --git a/Documentation/device-mapper/dm-raid.txt b/Documentation/device-mapper/dm-raid.txt index 33b6b7071ac8..2a8c11331d2d 100644 --- a/Documentation/device-mapper/dm-raid.txt +++ b/Documentation/device-mapper/dm-raid.txt | |||
@@ -1,70 +1,108 @@ | |||
1 | Device-mapper RAID (dm-raid) is a bridge from DM to MD. It | 1 | dm-raid |
2 | provides a way to use device-mapper interfaces to access the MD RAID | 2 | ------- |
3 | drivers. | ||
4 | 3 | ||
5 | As with all device-mapper targets, the nominal public interfaces are the | 4 | The device-mapper RAID (dm-raid) target provides a bridge from DM to MD. |
6 | constructor (CTR) tables and the status outputs (both STATUSTYPE_INFO | 5 | It allows the MD RAID drivers to be accessed using a device-mapper |
7 | and STATUSTYPE_TABLE). The CTR table looks like the following: | 6 | interface. |
8 | 7 | ||
9 | 1: <s> <l> raid \ | 8 | The target is named "raid" and it accepts the following parameters: |
10 | 2: <raid_type> <#raid_params> <raid_params> \ | 9 | |
11 | 3: <#raid_devs> <meta_dev1> <dev1> .. <meta_devN> <devN> | 10 | <raid_type> <#raid_params> <raid_params> \ |
12 | 11 | <#raid_devs> <metadata_dev0> <dev0> [.. <metadata_devN> <devN>] | |
13 | Line 1 contains the standard first three arguments to any device-mapper | 12 | |
14 | target - the start, length, and target type fields. The target type in | 13 | <raid_type>: |
15 | this case is "raid". | 14 | raid1 RAID1 mirroring |
16 | 15 | raid4 RAID4 dedicated parity disk | |
17 | Line 2 contains the arguments that define the particular raid | 16 | raid5_la RAID5 left asymmetric |
18 | type/personality/level, the required arguments for that raid type, and | 17 | - rotating parity 0 with data continuation |
19 | any optional arguments. Possible raid types include: raid4, raid5_la, | 18 | raid5_ra RAID5 right asymmetric |
20 | raid5_ls, raid5_rs, raid6_zr, raid6_nr, and raid6_nc. (raid1 is | 19 | - rotating parity N with data continuation |
21 | planned for the future.) The list of required and optional parameters | 20 | raid5_ls RAID5 left symmetric |
22 | is the same for all the current raid types. The required parameters are | 21 | - rotating parity 0 with data restart |
23 | positional, while the optional parameters are given as key/value pairs. | 22 | raid5_rs RAID5 right symmetric |
24 | The possible parameters are as follows: | 23 | - rotating parity N with data restart |
25 | <chunk_size> Chunk size in sectors. | 24 | raid6_zr RAID6 zero restart |
26 | [[no]sync] Force/Prevent RAID initialization | 25 | - rotating parity zero (left-to-right) with data restart |
27 | [rebuild <idx>] Rebuild the drive indicated by the index | 26 | raid6_nr RAID6 N restart |
28 | [daemon_sleep <ms>] Time between bitmap daemon work to clear bits | 27 | - rotating parity N (right-to-left) with data restart |
29 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 28 | raid6_nc RAID6 N continue |
30 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 29 | - rotating parity N (right-to-left) with data continuation |
31 | [max_write_behind <sectors>] See '-write-behind=' (man mdadm) | 30 | |
32 | [stripe_cache <sectors>] Stripe cache size for higher RAIDs | 31 | Refererence: Chapter 4 of |
33 | 32 | http://www.snia.org/sites/default/files/SNIA_DDF_Technical_Position_v2.0.pdf | |
34 | Line 3 contains the list of devices that compose the array in | 33 | |
35 | metadata/data device pairs. If the metadata is stored separately, a '-' | 34 | <#raid_params>: The number of parameters that follow. |
36 | is given for the metadata device position. If a drive has failed or is | 35 | |
37 | missing at creation time, a '-' can be given for both the metadata and | 36 | <raid_params> consists of |
38 | data drives for a given position. | 37 | Mandatory parameters: |
39 | 38 | <chunk_size>: Chunk size in sectors. This parameter is often known as | |
40 | NB. Currently all metadata devices must be specified as '-'. | 39 | "stripe size". It is the only mandatory parameter and |
41 | 40 | is placed first. | |
42 | Examples: | 41 | |
43 | # RAID4 - 4 data drives, 1 parity | 42 | followed by optional parameters (in any order): |
43 | [sync|nosync] Force or prevent RAID initialization. | ||
44 | |||
45 | [rebuild <idx>] Rebuild drive number idx (first drive is 0). | ||
46 | |||
47 | [daemon_sleep <ms>] | ||
48 | Interval between runs of the bitmap daemon that | ||
49 | clear bits. A longer interval means less bitmap I/O but | ||
50 | resyncing after a failure is likely to take longer. | ||
51 | |||
52 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization | ||
53 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization | ||
54 | [write_mostly <idx>] Drive index is write-mostly | ||
55 | [max_write_behind <sectors>] See '-write-behind=' (man mdadm) | ||
56 | [stripe_cache <sectors>] Stripe cache size (higher RAIDs only) | ||
57 | [region_size <sectors>] | ||
58 | The region_size multiplied by the number of regions is the | ||
59 | logical size of the array. The bitmap records the device | ||
60 | synchronisation state for each region. | ||
61 | |||
62 | <#raid_devs>: The number of devices composing the array. | ||
63 | Each device consists of two entries. The first is the device | ||
64 | containing the metadata (if any); the second is the one containing the | ||
65 | data. | ||
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 | |||
71 | Example tables | ||
72 | -------------- | ||
73 | # RAID4 - 4 data drives, 1 parity (no metadata devices) | ||
44 | # No metadata devices specified to hold superblock/bitmap info | 74 | # No metadata devices specified to hold superblock/bitmap info |
45 | # Chunk size of 1MiB | 75 | # Chunk size of 1MiB |
46 | # (Lines separated for easy reading) | 76 | # (Lines separated for easy reading) |
77 | |||
47 | 0 1960893648 raid \ | 78 | 0 1960893648 raid \ |
48 | raid4 1 2048 \ | 79 | raid4 1 2048 \ |
49 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 | 80 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 |
50 | 81 | ||
51 | # RAID4 - 4 data drives, 1 parity (no metadata devices) | 82 | # RAID4 - 4 data drives, 1 parity (with metadata devices) |
52 | # Chunk size of 1MiB, force RAID initialization, | 83 | # Chunk size of 1MiB, force RAID initialization, |
53 | # min recovery rate at 20 kiB/sec/disk | 84 | # min recovery rate at 20 kiB/sec/disk |
85 | |||
54 | 0 1960893648 raid \ | 86 | 0 1960893648 raid \ |
55 | raid4 4 2048 min_recovery_rate 20 sync\ | 87 | raid4 4 2048 sync min_recovery_rate 20 \ |
56 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 | 88 | 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82 |
57 | 89 | ||
58 | Performing a 'dmsetup table' should display the CTR table used to | 90 | 'dmsetup table' displays the table used to construct the mapping. |
59 | construct the mapping (with possible reordering of optional | 91 | The optional parameters are always printed in the order listed |
60 | parameters). | 92 | above with "sync" or "nosync" always output ahead of the other |
93 | arguments, regardless of the order used when originally loading the table. | ||
94 | Arguments that can be repeated are ordered by value. | ||
61 | 95 | ||
62 | Performing a 'dmsetup status' will yield information on the state and | 96 | 'dmsetup status' yields information on the state and health of the |
63 | health of the array. The output is as follows: | 97 | array. |
98 | The output is as follows: | ||
64 | 1: <s> <l> raid \ | 99 | 1: <s> <l> raid \ |
65 | 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio> | 100 | 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio> |
66 | 101 | ||
67 | Line 1 is standard DM output. Line 2 is best shown by example: | 102 | Line 1 is the standard output produced by device-mapper. |
103 | Line 2 is produced by the raid target, and best explained by example: | ||
68 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 | 104 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 |
69 | Here we can see the RAID type is raid4, there are 5 devices - all of | 105 | Here we can see the RAID type is raid4, there are 5 devices - all of |
70 | which are 'A'live, and the array is 2/490221568 complete with recovery. | 106 | which are 'A'live, and the array is 2/490221568 complete with recovery. |
107 | Faulty or missing devices are marked 'D'. Devices that are out-of-sync | ||
108 | are marked 'a'. | ||