GNU Linux-libre 6.6.34-gnu
[releases.git] / Documentation / admin-guide / device-mapper / delay.rst
1 ========
2 dm-delay
3 ========
4
5 Device-Mapper's "delay" target delays reads and/or writes
6 and maps them to different devices.
7
8 Parameters::
9
10     <device> <offset> <delay> [<write_device> <write_offset> <write_delay>
11                                [<flush_device> <flush_offset> <flush_delay>]]
12
13 With separate write parameters, the first set is only used for reads.
14 Offsets are specified in sectors.
15 Delays are specified in milliseconds.
16
17 Example scripts
18 ===============
19
20 ::
21
22         #!/bin/sh
23         # Create device delaying rw operation for 500ms
24         echo "0 `blockdev --getsz $1` delay $1 0 500" | dmsetup create delayed
25
26 ::
27
28         #!/bin/sh
29         # Create device delaying only write operation for 500ms and
30         # splitting reads and writes to different devices $1 $2
31         echo "0 `blockdev --getsz $1` delay $1 0 0 $2 0 500" | dmsetup create delayed