16cf2a73cSMauro Carvalho Chehab======== 26cf2a73cSMauro Carvalho Chehabdm-delay 36cf2a73cSMauro Carvalho Chehab======== 46cf2a73cSMauro Carvalho Chehab 56cf2a73cSMauro Carvalho ChehabDevice-Mapper's "delay" target delays reads and/or writes 6*5d3691a8SHeinz Mauelshagenand/or flushs and optionally maps them to different devices. 76cf2a73cSMauro Carvalho Chehab 8*5d3691a8SHeinz MauelshagenArguments:: 96cf2a73cSMauro Carvalho Chehab 106cf2a73cSMauro Carvalho Chehab <device> <offset> <delay> [<write_device> <write_offset> <write_delay> 116cf2a73cSMauro Carvalho Chehab [<flush_device> <flush_offset> <flush_delay>]] 126cf2a73cSMauro Carvalho Chehab 13*5d3691a8SHeinz MauelshagenTable line has to either have 3, 6 or 9 arguments: 14*5d3691a8SHeinz Mauelshagen 15*5d3691a8SHeinz Mauelshagen3: apply offset and delay to read, write and flush operations on device 16*5d3691a8SHeinz Mauelshagen 17*5d3691a8SHeinz Mauelshagen6: apply offset and delay to device, also apply write_offset and write_delay 18*5d3691a8SHeinz Mauelshagen to write and flush operations on optionally different write_device with 19*5d3691a8SHeinz Mauelshagen optionally different sector offset 20*5d3691a8SHeinz Mauelshagen 21*5d3691a8SHeinz Mauelshagen9: same as 6 arguments plus define flush_offset and flush_delay explicitely 22*5d3691a8SHeinz Mauelshagen on/with optionally different flush_device/flush_offset. 23*5d3691a8SHeinz Mauelshagen 246cf2a73cSMauro Carvalho ChehabOffsets are specified in sectors. 25*5d3691a8SHeinz Mauelshagen 266cf2a73cSMauro Carvalho ChehabDelays are specified in milliseconds. 276cf2a73cSMauro Carvalho Chehab 28*5d3691a8SHeinz Mauelshagen 296cf2a73cSMauro Carvalho ChehabExample scripts 306cf2a73cSMauro Carvalho Chehab=============== 316cf2a73cSMauro Carvalho Chehab 326cf2a73cSMauro Carvalho Chehab:: 336cf2a73cSMauro Carvalho Chehab #!/bin/sh 34*5d3691a8SHeinz Mauelshagen # 35*5d3691a8SHeinz Mauelshagen # Create mapped device named "delayed" delaying read, write and flush operations for 500ms. 36*5d3691a8SHeinz Mauelshagen # 37*5d3691a8SHeinz Mauelshagen dmsetup create delayed --table "0 `blockdev --getsz $1` delay $1 0 500" 386cf2a73cSMauro Carvalho Chehab 396cf2a73cSMauro Carvalho Chehab:: 406cf2a73cSMauro Carvalho Chehab #!/bin/sh 41*5d3691a8SHeinz Mauelshagen # 42*5d3691a8SHeinz Mauelshagen # Create mapped device delaying write and flush operations for 400ms and 43*5d3691a8SHeinz Mauelshagen # splitting reads to device $1 but writes and flushs to different device $2 44*5d3691a8SHeinz Mauelshagen # to different offsets of 2048 and 4096 sectors respectively. 45*5d3691a8SHeinz Mauelshagen # 46*5d3691a8SHeinz Mauelshagen dmsetup create delayed --table "0 `blockdev --getsz $1` delay $1 2048 0 $2 4096 400" 47*5d3691a8SHeinz Mauelshagen 48*5d3691a8SHeinz Mauelshagen:: 49*5d3691a8SHeinz Mauelshagen #!/bin/sh 50*5d3691a8SHeinz Mauelshagen # 51*5d3691a8SHeinz Mauelshagen # Create mapped device delaying reads for 50ms, writes for 100ms and flushs for 333ms 52*5d3691a8SHeinz Mauelshagen # onto the same backing device at offset 0 sectors. 53*5d3691a8SHeinz Mauelshagen # 54*5d3691a8SHeinz Mauelshagen dmsetup create delayed --table "0 `blockdev --getsz $1` delay $1 0 50 $2 0 100 $1 0 333" 55