ia64/linux-2.6.18-xen.hg

view Documentation/device-mapper/striped.txt @ 524:7f8b544237bf

netfront: Allow netfront in domain 0.

This is useful if your physical network device is in a utility domain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Apr 15 15:18:58 2008 +0100 (2008-04-15)
parents 831230e53067
children
line source
1 dm-stripe
2 =========
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.
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.
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.
23 Example scripts
24 ===============
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.
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);
37 if (!$num_devs) {
38 die("Specify at least one device\n");
39 }
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 }
48 $stripe_dev_size = $min_dev_size * $num_devs;
49 $stripe_dev_size -= $stripe_dev_size % ($chunk_size * $num_devs);
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 }
56 `echo $table | dmsetup create $dev_name`;
57 ]]