aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-08-03 02:49:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-08-03 02:49:21 -0400
commitf3406816bb2486fc44558bec77179cd9bcbd4450 (patch)
tree718db1ef45e55314b5e7290f77e70e6328d855a4 /Documentation
parent4400478ba3d939b680810aa004f1e954b4f8ba16 (diff)
parented8b752bccf2560e305e25125721d2f0ac759e88 (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.txt21
-rw-r--r--Documentation/device-mapper/dm-flakey.txt48
-rw-r--r--Documentation/device-mapper/dm-raid.txt138
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
4Device-Mapper's "crypt" target provides transparent encryption of block devices 4Device-Mapper's "crypt" target provides transparent encryption of block devices
5using the kernel crypto API. 5using the kernel crypto API.
6 6
7Parameters: <cipher> <key> <iv_offset> <device path> <offset> 7Parameters: <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
49allow_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
40Example scripts 59Example scripts
41=============== 60===============
42LUKS (Linux Unified Key Setup) is now the preferred way to set up disk 61LUKS (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 @@
1dm-flakey 1dm-flakey
2========= 2=========
3 3
4This target is the same as the linear target except that it returns I/O 4This target is the same as the linear target except that it exhibits
5errors periodically. It's been found useful in simulating failing 5unreliable behaviour periodically. It's been found useful in simulating
6devices for testing purposes. 6failing devices for testing purposes.
7 7
8Starting from the time the table is loaded, the device is available for 8Starting 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
10and then this cycle repeats. 10interval> seconds, and then this cycle repeats.
11 11
12Parameters: <dev path> <offset> <up interval> <down interval> 12Also, consider using this in combination with the dm-delay target too,
13which can delay reads and writes and/or send them to different
14underlying devices.
15
16Table parameters
17----------------
18 <dev path> <offset> <up interval> <down interval> \
19 [<num_features> [<feature arguments>]]
20
21Mandatory 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
28Optional 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
48Examples:
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 @@
1Device-mapper RAID (dm-raid) is a bridge from DM to MD. It 1dm-raid
2provides a way to use device-mapper interfaces to access the MD RAID 2-------
3drivers.
4 3
5As with all device-mapper targets, the nominal public interfaces are the 4The device-mapper RAID (dm-raid) target provides a bridge from DM to MD.
6constructor (CTR) tables and the status outputs (both STATUSTYPE_INFO 5It allows the MD RAID drivers to be accessed using a device-mapper
7and STATUSTYPE_TABLE). The CTR table looks like the following: 6interface.
8 7
91: <s> <l> raid \ 8The target is named "raid" and it accepts the following parameters:
102: <raid_type> <#raid_params> <raid_params> \ 9
113: <#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>]
13Line 1 contains the standard first three arguments to any device-mapper 12
14target - the start, length, and target type fields. The target type in 13<raid_type>:
15this case is "raid". 14 raid1 RAID1 mirroring
16 15 raid4 RAID4 dedicated parity disk
17Line 2 contains the arguments that define the particular raid 16 raid5_la RAID5 left asymmetric
18type/personality/level, the required arguments for that raid type, and 17 - rotating parity 0 with data continuation
19any optional arguments. Possible raid types include: raid4, raid5_la, 18 raid5_ra RAID5 right asymmetric
20raid5_ls, raid5_rs, raid6_zr, raid6_nr, and raid6_nc. (raid1 is 19 - rotating parity N with data continuation
21planned for the future.) The list of required and optional parameters 20 raid5_ls RAID5 left symmetric
22is the same for all the current raid types. The required parameters are 21 - rotating parity 0 with data restart
23positional, while the optional parameters are given as key/value pairs. 22 raid5_rs RAID5 right symmetric
24The 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
34Line 3 contains the list of devices that compose the array in 33
35metadata/data device pairs. If the metadata is stored separately, a '-' 34<#raid_params>: The number of parameters that follow.
36is given for the metadata device position. If a drive has failed or is 35
37missing at creation time, a '-' can be given for both the metadata and 36<raid_params> consists of
38data drives for a given position. 37 Mandatory parameters:
39 38 <chunk_size>: Chunk size in sectors. This parameter is often known as
40NB. Currently all metadata devices must be specified as '-'. 39 "stripe size". It is the only mandatory parameter and
41 40 is placed first.
42Examples: 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
71Example 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
470 1960893648 raid \ 780 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
540 1960893648 raid \ 860 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
58Performing a 'dmsetup table' should display the CTR table used to 90'dmsetup table' displays the table used to construct the mapping.
59construct the mapping (with possible reordering of optional 91The optional parameters are always printed in the order listed
60parameters). 92above with "sync" or "nosync" always output ahead of the other
93arguments, regardless of the order used when originally loading the table.
94Arguments that can be repeated are ordered by value.
61 95
62Performing a 'dmsetup status' will yield information on the state and 96'dmsetup status' yields information on the state and health of the
63health of the array. The output is as follows: 97array.
98The output is as follows:
641: <s> <l> raid \ 991: <s> <l> raid \
652: <raid_type> <#devices> <1 health char for each dev> <resync_ratio> 1002: <raid_type> <#devices> <1 health char for each dev> <resync_ratio>
66 101
67Line 1 is standard DM output. Line 2 is best shown by example: 102Line 1 is the standard output produced by device-mapper.
103Line 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
69Here we can see the RAID type is raid4, there are 5 devices - all of 105Here we can see the RAID type is raid4, there are 5 devices - all of
70which are 'A'live, and the array is 2/490221568 complete with recovery. 106which are 'A'live, and the array is 2/490221568 complete with recovery.
107Faulty or missing devices are marked 'D'. Devices that are out-of-sync
108are marked 'a'.