Root/
1 | dm-stripe |
2 | ========= |
3 | |
4 | Device-Mapper's "striped" target is used to create a striped (i.e. RAID-0) |
5 | device across one or more underlying devices. Data is written in "chunks", |
6 | with consecutive chunks rotating among the underlying devices. This can |
7 | potentially provide improved I/O throughput by utilizing several physical |
8 | devices in parallel. |
9 | |
10 | Parameters: <num devs> <chunk size> [<dev path> <offset>]+ |
11 | <num devs>: Number of underlying devices. |
12 | <chunk size>: Size of each chunk of data. Must be a power-of-2 and at |
13 | least as large as the system's PAGE_SIZE. |
14 | <dev path>: Full pathname to the underlying block-device, or a |
15 | "major:minor" device-number. |
16 | <offset>: Starting sector within the device. |
17 | |
18 | One or more underlying devices can be specified. The striped device size must |
19 | be a multiple of the chunk size and a multiple of the number of underlying |
20 | devices. |
21 | |
22 | |
23 | Example scripts |
24 | =============== |
25 | |
26 | [[ |
27 | #!/usr/bin/perl -w |
28 | # Create a striped device across any number of underlying devices. The device |
29 | # will be called "stripe_dev" and have a chunk-size of 128k. |
30 | |
31 | my $chunk_size = 128 * 2; |
32 | my $dev_name = "stripe_dev"; |
33 | my $num_devs = @ARGV; |
34 | my @devs = @ARGV; |
35 | my ($min_dev_size, $stripe_dev_size, $i); |
36 | |
37 | if (!$num_devs) { |
38 | die("Specify at least one device\n"); |
39 | } |
40 | |
41 | $min_dev_size = `blockdev --getsize $devs[0]`; |
42 | for ($i = 1; $i < $num_devs; $i++) { |
43 | my $this_size = `blockdev --getsize $devs[$i]`; |
44 | $min_dev_size = ($min_dev_size < $this_size) ? |
45 | $min_dev_size : $this_size; |
46 | } |
47 | |
48 | $stripe_dev_size = $min_dev_size * $num_devs; |
49 | $stripe_dev_size -= $stripe_dev_size % ($chunk_size * $num_devs); |
50 | |
51 | $table = "0 $stripe_dev_size striped $num_devs $chunk_size"; |
52 | for ($i = 0; $i < $num_devs; $i++) { |
53 | $table .= " $devs[$i] 0"; |
54 | } |
55 | |
56 | `echo $table | dmsetup create $dev_name`; |
57 | ]] |
58 | |
59 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9