€•®ŠŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ5/translations/zh_CN/admin-guide/device-mapper/dm-dust”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/zh_TW/admin-guide/device-mapper/dm-dust”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/it_IT/admin-guide/device-mapper/dm-dust”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ja_JP/admin-guide/device-mapper/dm-dust”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ko_KR/admin-guide/device-mapper/dm-dust”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/pt_BR/admin-guide/device-mapper/dm-dust”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/sp_SP/admin-guide/device-mapper/dm-dust”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒdm-dust”h]”hŒdm-dust”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒO/var/lib/git/docbuild/linux/Documentation/admin-guide/device-mapper/dm-dust.rst”h´KubhŒ paragraph”“”)”}”(hŒ–This target emulates the behavior of bad sectors at arbitrary locations, and the ability to enable the emulation of the failures at an arbitrary time.”h]”hŒ–This target emulates the behavior of bad sectors at arbitrary locations, and the ability to enable the emulation of the failures at an arbitrary time.”…””}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒàThis target behaves similarly to a linear target. At a given time, the user can send a message to the target to start failing read requests on specific blocks (to emulate the behavior of a hard disk drive with bad sectors).”h]”hŒàThis target behaves similarly to a linear target. At a given time, the user can send a message to the target to start failing read requests on specific blocks (to emulate the behavior of a hard disk drive with bad sectors).”…””}”(hhÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒÆWhen the failure behavior is enabled (i.e.: when the output of "dmsetup status" displays "fail_read_on_bad_block"), reads of blocks in the "bad block list" will fail with EIO ("Input/output error").”h]”hŒÖWhen the failure behavior is enabled (i.e.: when the output of “dmsetup status†displays “fail_read_on_bad_blockâ€), reads of blocks in the “bad block list†will fail with EIO (“Input/output errorâ€).”…””}”(hhéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hh·h²hubhÌ)”}”(hŒEWrites of blocks in the "bad block list will result in the following:”h]”hŒGWrites of blocks in the “bad block list will result in the following:”…””}”(hh÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhŒenumerated_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ+Remove the block from the "bad block list".”h]”hÌ)”}”(hjh]”hŒ/Remove the block from the “bad block listâ€.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjh²hh³hÊh´Nubj )”}”(hŒ!Successfully complete the write. ”h]”hÌ)”}”(hŒ Successfully complete the write.”h]”hŒ Successfully complete the write.”…””}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj#ubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjh²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jhh·h²hh³hÊh´KubhÌ)”}”(hŒIThis emulates the "remapped sector" behavior of a drive with bad sectors.”h]”hŒMThis emulates the “remapped sector†behavior of a drive with bad sectors.”…””}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hXNormally, a drive that is encountering bad sectors will most likely encounter more bad sectors, at an unknown time or location. With dm-dust, the user can use the "addbadblock" and "removebadblock" messages to add arbitrary bad blocks at new locations, and the "enable" and "disable" messages to modulate the state of whether the configured "bad blocks" will be treated as bad, or bypassed. This allows the pre-writing of test data and metadata prior to simulating a "failure" event where bad sectors start to appear.”h]”hXNormally, a drive that is encountering bad sectors will most likely encounter more bad sectors, at an unknown time or location. With dm-dust, the user can use the “addbadblock†and “removebadblock†messages to add arbitrary bad blocks at new locations, and the “enable†and “disable†messages to modulate the state of whether the configured “bad blocks†will be treated as bad, or bypassed. This allows the pre-writing of test data and metadata prior to simulating a “failure†event where bad sectors start to appear.”…””}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒTable parameters”h]”hŒTable parameters”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjbh²hh³hÊh´K#ubhÌ)”}”(hŒ ”h]”hŒ ”…””}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K$hjbh²hubhŒdefinition_list”“”)”}”(hhh]”hŒdefinition_list_item”“”)”}”(hŒäMandatory parameters: : Path to the block device. : Offset to data area from start of device_path : Block size in bytes (minimum 512, maximum 1073741824, must be a power of 2) ”h]”(hŒterm”“”)”}”(hŒMandatory parameters:”h]”hŒMandatory parameters:”…””}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jŒh³hÊh´K0hjˆubhŒ definition”“”)”}”(hhh]”j‚)”}”(hhh]”(j‡)”}”(hŒ): Path to the block device. ”h]”(j)”}”(hŒ:”h]”hŒ:”…””}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jŒh³hÊh´K(hj¤ubj)”}”(hhh]”hÌ)”}”(hŒPath to the block device.”h]”hŒPath to the block device.”…””}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K(hj¶ubah}”(h]”h ]”h"]”h$]”h&]”uh1jœhj¤ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j†h³hÊh´K(hj¡ubj‡)”}”(hŒ8: Offset to data area from start of device_path ”h]”(j)”}”(hŒ :”h]”hŒ :”…””}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jŒh³hÊh´K+hjÓubj)”}”(hhh]”hÌ)”}”(hŒ-Offset to data area from start of device_path”h]”hŒ-Offset to data area from start of device_path”…””}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K+hjåubah}”(h]”h ]”h"]”h$]”h&]”uh1jœhjÓubeh}”(h]”h ]”h"]”h$]”h&]”uh1j†h³hÊh´K+hj¡ubj‡)”}”(hŒ[: Block size in bytes (minimum 512, maximum 1073741824, must be a power of 2) ”h]”(j)”}”(hŒ:”h]”hŒ:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jŒh³hÊh´K0hjubj)”}”(hhh]”(hÌ)”}”(hŒBlock size in bytes”h]”hŒBlock size in bytes”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K.hjubhŒ block_quote”“”)”}”(hŒ8(minimum 512, maximum 1073741824, must be a power of 2) ”h]”hÌ)”}”(hŒ7(minimum 512, maximum 1073741824, must be a power of 2)”h]”hŒ7(minimum 512, maximum 1073741824, must be a power of 2)”…””}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K0hj'ubah}”(h]”h ]”h"]”h$]”h&]”uh1j%h³hÊh´K0hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jœhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j†h³hÊh´K0hj¡ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjžubah}”(h]”h ]”h"]”h$]”h&]”uh1jœhjˆubeh}”(h]”h ]”h"]”h$]”h&]”uh1j†h³hÊh´K0hjƒubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjbh²hh³Nh´Nubeh}”(h]”Œtable-parameters”ah ]”h"]”Œtable parameters”ah$]”h&]”uh1hµhh·h²hh³hÊh´K#ubh¶)”}”(hhh]”(h»)”}”(hŒUsage instructions”h]”hŒUsage instructions”…””}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjkh²hh³hÊh´K3ubhÌ)”}”(hŒEFirst, find the size (in 512-byte sectors) of the device to be used::”h]”hŒDFirst, find the size (in 512-byte sectors) of the device to be used:”…””}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K5hjkh²hubhŒ literal_block”“”)”}”(hŒ*$ sudo blockdev --getsz /dev/vdb1 33552384”h]”hŒ*$ sudo blockdev --getsz /dev/vdb1 33552384”…””}”hjŒsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jŠh³hÊh´K7hjkh²hubhÌ)”}”(hŒHCreate the dm-dust device: (For a device with a block size of 512 bytes)”h]”hŒHCreate the dm-dust device: (For a device with a block size of 512 bytes)”…””}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K:hjkh²hubj‹)”}”(hŒE$ sudo dmsetup create dust1 --table '0 33552384 dust /dev/vdb1 0 512'”h]”hŒE$ sudo dmsetup create dust1 --table '0 33552384 dust /dev/vdb1 0 512'”…””}”hjªsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´K?hjkh²hubhÌ)”}”(hŒ.(For a device with a block size of 4096 bytes)”h]”hŒ.(For a device with a block size of 4096 bytes)”…””}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KAhjkh²hubj‹)”}”(hŒF$ sudo dmsetup create dust1 --table '0 33552384 dust /dev/vdb1 0 4096'”h]”hŒF$ sudo dmsetup create dust1 --table '0 33552384 dust /dev/vdb1 0 4096'”…””}”hjÆsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´KEhjkh²hubhÌ)”}”(hŒÖCheck the status of the read behavior ("bypass" indicates that all I/O will be passed through to the underlying device; "verbose" indicates that bad block additions, removals, and remaps will be verbosely logged)::”h]”hŒÝCheck the status of the read behavior (“bypass†indicates that all I/O will be passed through to the underlying device; “verbose†indicates that bad block additions, removals, and remaps will be verbosely logged):”…””}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KGhjkh²hubj‹)”}”(hX$ sudo dmsetup status dust1 0 33552384 dust 252:17 bypass verbose $ sudo dd if=/dev/mapper/dust1 of=/dev/null bs=512 count=128 iflag=direct 128+0 records in 128+0 records out $ sudo dd if=/dev/zero of=/dev/mapper/dust1 bs=512 count=128 oflag=direct 128+0 records in 128+0 records out”h]”hX$ sudo dmsetup status dust1 0 33552384 dust 252:17 bypass verbose $ sudo dd if=/dev/mapper/dust1 of=/dev/null bs=512 count=128 iflag=direct 128+0 records in 128+0 records out $ sudo dd if=/dev/zero of=/dev/mapper/dust1 bs=512 count=128 oflag=direct 128+0 records in 128+0 records out”…””}”hjâsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´KKhjkh²hubeh}”(h]”Œusage-instructions”ah ]”h"]”Œusage instructions”ah$]”h&]”uh1hµhh·h²hh³hÊh´K3ubh¶)”}”(hhh]”(h»)”}”(hŒAdding and removing bad blocks”h]”hŒAdding and removing bad blocks”…””}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjøh²hh³hÊh´KWubhÌ)”}”(hŒÂAt any time (i.e.: whether the device has the "bad block" emulation enabled or disabled), bad blocks may be added or removed from the device via the "addbadblock" and "removebadblock" messages::”h]”hŒÍAt any time (i.e.: whether the device has the “bad block†emulation enabled or disabled), bad blocks may be added or removed from the device via the “addbadblock†and “removebadblock†messages:”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KYhjøh²hubj‹)”}”(hX3$ sudo dmsetup message dust1 0 addbadblock 60 kernel: device-mapper: dust: badblock added at block 60 $ sudo dmsetup message dust1 0 addbadblock 67 kernel: device-mapper: dust: badblock added at block 67 $ sudo dmsetup message dust1 0 addbadblock 72 kernel: device-mapper: dust: badblock added at block 72”h]”hX3$ sudo dmsetup message dust1 0 addbadblock 60 kernel: device-mapper: dust: badblock added at block 60 $ sudo dmsetup message dust1 0 addbadblock 67 kernel: device-mapper: dust: badblock added at block 67 $ sudo dmsetup message dust1 0 addbadblock 72 kernel: device-mapper: dust: badblock added at block 72”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´K]hjøh²hubhÌ)”}”(hŒ~These bad blocks will be stored in the "bad block list". While the device is in "bypass" mode, reads and writes will succeed::”h]”hŒ…These bad blocks will be stored in the “bad block listâ€. While the device is in “bypass†mode, reads and writes will succeed:”…””}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kfhjøh²hubj‹)”}”(hŒ9$ sudo dmsetup status dust1 0 33552384 dust 252:17 bypass”h]”hŒ9$ sudo dmsetup status dust1 0 33552384 dust 252:17 bypass”…””}”hj3sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´Kihjøh²hubeh}”(h]”Œadding-and-removing-bad-blocks”ah ]”h"]”Œadding and removing bad blocks”ah$]”h&]”uh1hµhh·h²hh³hÊh´KWubh¶)”}”(hhh]”(h»)”}”(hŒEnabling block read failures”h]”hŒEnabling block read failures”…””}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjIh²hh³hÊh´KmubhÌ)”}”(hŒLTo enable the "fail read on bad block" behavior, send the "enable" message::”h]”hŒSTo enable the “fail read on bad block†behavior, send the “enable†message:”…””}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KohjIh²hubj‹)”}”(hŒ³$ sudo dmsetup message dust1 0 enable kernel: device-mapper: dust: enabling read failures on bad sectors $ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block”h]”hŒ³$ sudo dmsetup message dust1 0 enable kernel: device-mapper: dust: enabling read failures on bad sectors $ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block”…””}”hjhsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´KqhjIh²hubhÌ)”}”(hŒuWith the device in "fail read on bad block" mode, attempting to read a block will encounter an "Input/output error"::”h]”hŒ|With the device in “fail read on bad block†mode, attempting to read a block will encounter an “Input/output errorâ€:”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KwhjIh²hubj‹)”}”(hŒÏ$ sudo dd if=/dev/mapper/dust1 of=/dev/null bs=512 count=1 skip=67 iflag=direct dd: error reading '/dev/mapper/dust1': Input/output error 0+0 records in 0+0 records out 0 bytes copied, 0.00040651 s, 0.0 kB/s”h]”hŒÏ$ sudo dd if=/dev/mapper/dust1 of=/dev/null bs=512 count=1 skip=67 iflag=direct dd: error reading '/dev/mapper/dust1': Input/output error 0+0 records in 0+0 records out 0 bytes copied, 0.00040651 s, 0.0 kB/s”…””}”hj„sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´KzhjIh²hubhÌ)”}”(hŒ…...and writing to the bad blocks will remove the blocks from the list, therefore emulating the "remap" behavior of hard disk drives::”h]”hŒˆ...and writing to the bad blocks will remove the blocks from the list, therefore emulating the “remap†behavior of hard disk drives:”…””}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K€hjIh²hubj‹)”}”(hX‘$ sudo dd if=/dev/zero of=/dev/mapper/dust1 bs=512 count=128 oflag=direct 128+0 records in 128+0 records out kernel: device-mapper: dust: block 60 removed from badblocklist by write kernel: device-mapper: dust: block 67 removed from badblocklist by write kernel: device-mapper: dust: block 72 removed from badblocklist by write kernel: device-mapper: dust: block 87 removed from badblocklist by write”h]”hX‘$ sudo dd if=/dev/zero of=/dev/mapper/dust1 bs=512 count=128 oflag=direct 128+0 records in 128+0 records out kernel: device-mapper: dust: block 60 removed from badblocklist by write kernel: device-mapper: dust: block 67 removed from badblocklist by write kernel: device-mapper: dust: block 72 removed from badblocklist by write kernel: device-mapper: dust: block 87 removed from badblocklist by write”…””}”hj sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´KƒhjIh²hubeh}”(h]”Œenabling-block-read-failures”ah ]”h"]”Œenabling block read failures”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kmubh¶)”}”(hhh]”(h»)”}”(hŒ#Bad block add/remove error handling”h]”hŒ#Bad block add/remove error handling”…””}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¶h²hh³hÊh´KubhÌ)”}”(hŒˆAttempting to add a bad block that already exists in the list will result in an "Invalid argument" error, as well as a helpful message::”h]”hŒ‹Attempting to add a bad block that already exists in the list will result in an “Invalid argument†error, as well as a helpful message:”…””}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj¶h²hubj‹)”}”(hŒ«$ sudo dmsetup message dust1 0 addbadblock 88 device-mapper: message ioctl on dust1 failed: Invalid argument kernel: device-mapper: dust: block 88 already in badblocklist”h]”hŒ«$ sudo dmsetup message dust1 0 addbadblock 88 device-mapper: message ioctl on dust1 failed: Invalid argument kernel: device-mapper: dust: block 88 already in badblocklist”…””}”hjÕsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´K’hj¶h²hubhÌ)”}”(hŒŠAttempting to remove a bad block that doesn't exist in the list will result in an "Invalid argument" error, as well as a helpful message::”h]”hŒAttempting to remove a bad block that doesn’t exist in the list will result in an “Invalid argument†error, as well as a helpful message:”…””}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K–hj¶h²hubj‹)”}”(hŒ°$ sudo dmsetup message dust1 0 removebadblock 87 device-mapper: message ioctl on dust1 failed: Invalid argument kernel: device-mapper: dust: block 87 not found in badblocklist”h]”hŒ°$ sudo dmsetup message dust1 0 removebadblock 87 device-mapper: message ioctl on dust1 failed: Invalid argument kernel: device-mapper: dust: block 87 not found in badblocklist”…””}”hjñsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´K™hj¶h²hubeh}”(h]”Œ#bad-block-add-remove-error-handling”ah ]”h"]”Œ#bad block add/remove error handling”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒ7Counting the number of bad blocks in the bad block list”h]”hŒ7Counting the number of bad blocks in the bad block list”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´KžubhÌ)”}”(hŒ_To count the number of bad blocks configured in the device, run the following message command::”h]”hŒ^To count the number of bad blocks configured in the device, run the following message command:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hjh²hubj‹)”}”(hŒ-$ sudo dmsetup message dust1 0 countbadblocks”h]”hŒ-$ sudo dmsetup message dust1 0 countbadblocks”…””}”hj&sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´K£hjh²hubhÌ)”}”(hŒWA message will print with the number of bad blocks currently configured on the device::”h]”hŒVA message will print with the number of bad blocks currently configured on the device:”…””}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¥hjh²hubj‹)”}”(hŒ%countbadblocks: 895 badblock(s) found”h]”hŒ%countbadblocks: 895 badblock(s) found”…””}”hjBsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´K¨hjh²hubeh}”(h]”Œ7counting-the-number-of-bad-blocks-in-the-bad-block-list”ah ]”h"]”Œ7counting the number of bad blocks in the bad block list”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kžubh¶)”}”(hhh]”(h»)”}”(hŒ Querying for specific bad blocks”h]”hŒ Querying for specific bad blocks”…””}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjXh²hh³hÊh´K«ubhÌ)”}”(hŒ]To find out if a specific block is in the bad block list, run the following message command::”h]”hŒ\To find out if a specific block is in the bad block list, run the following message command:”…””}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K­hjXh²hubj‹)”}”(hŒ,$ sudo dmsetup message dust1 0 queryblock 72”h]”hŒ,$ sudo dmsetup message dust1 0 queryblock 72”…””}”hjwsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´K°hjXh²hubhÌ)”}”(hŒ>The following message will print if the block is in the list::”h]”hŒ=The following message will print if the block is in the list:”…””}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K²hjXh²hubj‹)”}”(hŒ0dust_query_block: block 72 found in badblocklist”h]”hŒ0dust_query_block: block 72 found in badblocklist”…””}”hj“sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´K´hjXh²hubhÌ)”}”(hŒBThe following message will print if the block is not in the list::”h]”hŒAThe following message will print if the block is not in the list:”…””}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¶hjXh²hubj‹)”}”(hŒ4dust_query_block: block 72 not found in badblocklist”h]”hŒ4dust_query_block: block 72 not found in badblocklist”…””}”hj¯sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´K¸hjXh²hubhÌ)”}”(hŒöThe "queryblock" message command will work in both the "enabled" and "disabled" modes, allowing the verification of whether a block will be treated as "bad" without having to issue I/O to the device, or having to "enable" the bad block emulation.”h]”hX The “queryblock†message command will work in both the “enabled†and “disabled†modes, allowing the verification of whether a block will be treated as “bad†without having to issue I/O to the device, or having to “enable†the bad block emulation.”…””}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KºhjXh²hubeh}”(h]”Œ querying-for-specific-bad-blocks”ah ]”h"]”Œ querying for specific bad blocks”ah$]”h&]”uh1hµhh·h²hh³hÊh´K«ubh¶)”}”(hhh]”(h»)”}”(hŒClearing the bad block list”h]”hŒClearing the bad block list”…””}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÓh²hh³hÊh´KÀubhÌ)”}”(hŒ™To clear the bad block list (without needing to individually run a "removebadblock" message command for every block), run the following message command::”h]”hŒœTo clear the bad block list (without needing to individually run a “removebadblock†message command for every block), run the following message command:”…””}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÂhjÓh²hubj‹)”}”(hŒ-$ sudo dmsetup message dust1 0 clearbadblocks”h]”hŒ-$ sudo dmsetup message dust1 0 clearbadblocks”…””}”hjòsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´KÆhjÓh²hubhÌ)”}”(hŒFAfter clearing the bad block list, the following message will appear::”h]”hŒEAfter clearing the bad block list, the following message will appear:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÈhjÓh²hubj‹)”}”(hŒ'dust_clear_badblocks: badblocks cleared”h]”hŒ'dust_clear_badblocks: badblocks cleared”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´KÊhjÓh²hubhÌ)”}”(hŒIIf there were no bad blocks to clear, the following message will appear::”h]”hŒHIf there were no bad blocks to clear, the following message will appear:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÌhjÓh²hubj‹)”}”(hŒ(dust_clear_badblocks: no badblocks found”h]”hŒ(dust_clear_badblocks: no badblocks found”…””}”hj*sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´KÏhjÓh²hubeh}”(h]”Œclearing-the-bad-block-list”ah ]”h"]”Œclearing the bad block list”ah$]”h&]”uh1hµhh·h²hh³hÊh´KÀubh¶)”}”(hhh]”(h»)”}”(hŒListing the bad block list”h]”hŒListing the bad block list”…””}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj@h²hh³hÊh´KÒubhÌ)”}”(hŒ•To list all bad blocks in the bad block list (using an example device with blocks 1 and 2 in the bad block list), run the following message command::”h]”hŒ”To list all bad blocks in the bad block list (using an example device with blocks 1 and 2 in the bad block list), run the following message command:”…””}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÔhj@h²hubj‹)”}”(hŒ0$ sudo dmsetup message dust1 0 listbadblocks 1 2”h]”hŒ0$ sudo dmsetup message dust1 0 listbadblocks 1 2”…””}”hj_sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´KØhj@h²hubhÌ)”}”(hŒ[If there are no bad blocks in the bad block list, the command will execute with no output::”h]”hŒZIf there are no bad blocks in the bad block list, the command will execute with no output:”…””}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÜhj@h²hubj‹)”}”(hŒ,$ sudo dmsetup message dust1 0 listbadblocks”h]”hŒ,$ sudo dmsetup message dust1 0 listbadblocks”…””}”hj{sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´Kßhj@h²hubeh}”(h]”Œlisting-the-bad-block-list”ah ]”h"]”Œlisting the bad block list”ah$]”h&]”uh1hµhh·h²hh³hÊh´KÒubh¶)”}”(hhh]”(h»)”}”(hŒMessage commands list”h]”hŒMessage commands list”…””}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj‘h²hh³hÊh´KâubhÌ)”}”(hŒBBelow is a list of the messages that can be sent to a dust device:”h]”hŒBBelow is a list of the messages that can be sent to a dust device:”…””}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kähj‘h²hubhÌ)”}”(hŒ5Operations on blocks (requires a argument)::”h]”hŒ4Operations on blocks (requires a argument):”…””}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kæhj‘h²hubj‹)”}”(hŒ@addbadblock queryblock removebadblock ”h]”hŒ@addbadblock queryblock removebadblock ”…””}”hj¾sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´Kèhj‘h²hubhÌ)”}”(hŒo...where is a block number within range of the device (corresponding to the block size of the device.)”h]”hŒo...where is a block number within range of the device (corresponding to the block size of the device.)”…””}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kìhj‘h²hubhÌ)”}”(hŒ"Single argument message commands::”h]”hŒ!Single argument message commands:”…””}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kïhj‘h²hubj‹)”}”(hŒ@countbadblocks clearbadblocks listbadblocks disable enable quiet”h]”hŒ@countbadblocks clearbadblocks listbadblocks disable enable quiet”…””}”hjèsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´Kñhj‘h²hubeh}”(h]”Œmessage-commands-list”ah ]”h"]”Œmessage commands list”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kâubh¶)”}”(hhh]”(h»)”}”(hŒDevice removal”h]”hŒDevice removal”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjþh²hh³hÊh´KùubhÌ)”}”(hŒCWhen finished, remove the device via the "dmsetup remove" command::”h]”hŒFWhen finished, remove the device via the “dmsetup remove†command:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kûhjþh²hubj‹)”}”(hŒ$ sudo dmsetup remove dust1”h]”hŒ$ sudo dmsetup remove dust1”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´Kýhjþh²hubeh}”(h]”Œdevice-removal”ah ]”h"]”Œdevice removal”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kùubh¶)”}”(hhh]”(h»)”}”(hŒ Quiet mode”h]”hŒ Quiet mode”…””}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj3h²hh³hÊh´MubhÌ)”}”(hŒÈOn test runs with many bad blocks, it may be desirable to avoid excessive logging (from bad blocks added, removed, or "remapped"). This can be done by enabling "quiet mode" via the following message::”h]”hŒÏOn test runs with many bad blocks, it may be desirable to avoid excessive logging (from bad blocks added, removed, or “remappedâ€). This can be done by enabling “quiet mode†via the following message:”…””}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj3h²hubj‹)”}”(hŒ$$ sudo dmsetup message dust1 0 quiet”h]”hŒ$$ sudo dmsetup message dust1 0 quiet”…””}”hjRsbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´Mhj3h²hubhÌ)”}”(hŒµThis will suppress log messages from add / remove / removed by write operations. Log messages from "countbadblocks" or "queryblock" message commands will still print in quiet mode.”h]”hŒ½This will suppress log messages from add / remove / removed by write operations. Log messages from “countbadblocks†or “queryblock†message commands will still print in quiet mode.”…””}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj3h²hubhÌ)”}”(hŒBThe status of quiet mode can be seen by running "dmsetup status"::”h]”hŒEThe status of quiet mode can be seen by running “dmsetup statusâ€:”…””}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hj3h²hubj‹)”}”(hŒO$ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block quiet”h]”hŒO$ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block quiet”…””}”hj|sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´Mhj3h²hubhÌ)”}”(hŒ7To disable quiet mode, send the "quiet" message again::”h]”hŒ:To disable quiet mode, send the “quiet†message again:”…””}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj3h²hubj‹)”}”(hŒw$ sudo dmsetup message dust1 0 quiet $ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block verbose”h]”hŒw$ sudo dmsetup message dust1 0 quiet $ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block verbose”…””}”hj˜sbah}”(h]”h ]”h"]”h$]”h&]”jšj›uh1jŠh³hÊh´Mhj3h²hubhÌ)”}”(hŒ5(The presence of "verbose" indicates normal logging.)”h]”hŒ9(The presence of “verbose†indicates normal logging.)”…””}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj3h²hubeh}”(h]”Œ quiet-mode”ah ]”h"]”Œ quiet mode”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mubh¶)”}”(hhh]”(h»)”}”(hŒ "Why not...?"”h]”hŒ“Why not...?—…””}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¼h²hh³hÊh´MubhÌ)”}”(hŒâscsi_debug has a "medium error" mode that can fail reads on one specified sector (sector 0x1234, hardcoded in the source code), but it uses RAM for the persistent storage, which drastically decreases the potential device size.”h]”hŒæscsi_debug has a “medium error†mode that can fail reads on one specified sector (sector 0x1234, hardcoded in the source code), but it uses RAM for the persistent storage, which drastically decreases the potential device size.”…””}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj¼h²hubhÌ)”}”(hŒndm-flakey fails all I/O from all block locations at a specified time frequency, and not a given point in time.”h]”hŒndm-flakey fails all I/O from all block locations at a specified time frequency, and not a given point in time.”…””}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M"hj¼h²hubhÌ)”}”(hX÷When a bad sector occurs on a hard disk drive, reads to that sector are failed by the device, usually resulting in an error code of EIO ("I/O error") or ENODATA ("No data available"). However, a write to the sector may succeed, and result in the sector becoming readable after the device controller no longer experiences errors reading the sector (or after a reallocation of the sector). However, there may be bad sectors that occur on the device in the future, in a different, unpredictable location.”h]”hXÿWhen a bad sector occurs on a hard disk drive, reads to that sector are failed by the device, usually resulting in an error code of EIO (“I/O errorâ€) or ENODATA (“No data availableâ€). However, a write to the sector may succeed, and result in the sector becoming readable after the device controller no longer experiences errors reading the sector (or after a reallocation of the sector). However, there may be bad sectors that occur on the device in the future, in a different, unpredictable location.”…””}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M%hj¼h²hubhÌ)”}”(hŒÛThis target seeks to provide a device that can exhibit the behavior of a bad sector at a known sector location, at a known time, based on a large storage device (at least tens of gigabytes, not occupying system memory).”h]”hŒÛThis target seeks to provide a device that can exhibit the behavior of a bad sector at a known sector location, at a known time, based on a large storage device (at least tens of gigabytes, not occupying system memory).”…””}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M.hj¼h²hubeh}”(h]”Œwhy-not”ah ]”h"]”Œ "why not...?"”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mubeh}”(h]”Œdm-dust”ah ]”h"]”Œdm-dust”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j8Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jjjhjejõjòjFjCj³j°jjjUjRjÐjÍj=j:jŽj‹jûjøj0j-j¹j¶j juŒ nametypes”}”(j‰jh‰jõ‰jF‰j³‰j‰jU‰jЉj=‰jމjû‰j0‰j¹‰j ‰uh}”(jh·jejbjòjkjCjøj°jIjj¶jRjjÍjXj:jÓj‹j@jøj‘j-jþj¶j3jj¼uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.