sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget5/translations/zh_CN/admin-guide/device-mapper/dm-dustmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/zh_TW/admin-guide/device-mapper/dm-dustmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/it_IT/admin-guide/device-mapper/dm-dustmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/ja_JP/admin-guide/device-mapper/dm-dustmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/ko_KR/admin-guide/device-mapper/dm-dustmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/sp_SP/admin-guide/device-mapper/dm-dustmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hdm-dusth]hdm-dust}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhO/var/lib/git/docbuild/linux/Documentation/admin-guide/device-mapper/dm-dust.rsthKubh paragraph)}(hThis 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]hThis target emulates the behavior of bad sectors at arbitrary locations, and the ability to enable the emulation of the failures at an arbitrary time.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThis 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]hThis 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).}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hWhen 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]hWhen 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”).}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hEWrites of blocks in the "bad block list will result in the following:h]hGWrites of blocks in the “bad block list will result in the following:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhenumerated_list)}(hhh](h list_item)}(h+Remove the block from the "bad block list".h]h)}(hhh]h/Remove the block from the “bad block list”.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(h!Successfully complete the write. h]h)}(h Successfully complete the write.h]h Successfully complete the write.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1hhhhhhhhKubh)}(hIThis emulates the "remapped sector" behavior of a drive with bad sectors.h]hMThis emulates the “remapped sector” behavior of a drive with bad sectors.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(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.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hTable parametersh]hTable parameters}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNhhhhhK#ubh)}(h h]h }(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjNhhubhdefinition_list)}(hhh]hdefinition_list_item)}(hMandatory 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](hterm)}(hMandatory parameters:h]hMandatory parameters:}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhhhK0hjtubh definition)}(hhh]jn)}(hhh](js)}(h): Path to the block device. h](jy)}(h:h]h:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhhhK(hjubj)}(hhh]h)}(hPath to the block device.h]hPath to the block device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jrhhhK(hjubjs)}(h8: Offset to data area from start of device_path h](jy)}(h :h]h :}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhhhK+hjubj)}(hhh]h)}(h-Offset to data area from start of device_pathh]h-Offset to data area from start of device_path}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jrhhhK+hjubjs)}(h[: Block size in bytes (minimum 512, maximum 1073741824, must be a power of 2) h](jy)}(h:h]h:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jxhhhK0hjubj)}(hhh](h)}(hBlock size in bytesh]hBlock size in bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubh block_quote)}(h8(minimum 512, maximum 1073741824, must be a power of 2) h]h)}(h7(minimum 512, maximum 1073741824, must be a power of 2)h]h7(minimum 512, maximum 1073741824, must be a power of 2)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hjubah}(h]h ]h"]h$]h&]uh1jhhhK0hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jrhhhK0hjubeh}(h]h ]h"]h$]h&]uh1jmhjubah}(h]h ]h"]h$]h&]uh1jhjtubeh}(h]h ]h"]h$]h&]uh1jrhhhK0hjoubah}(h]h ]h"]h$]h&]uh1jmhjNhhhNhNubeh}(h]table-parametersah ]h"]table parametersah$]h&]uh1hhhhhhhhK#ubh)}(hhh](h)}(hUsage instructionsh]hUsage instructions}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjWhhhhhK3ubh)}(hEFirst, find the size (in 512-byte sectors) of the device to be used::h]hDFirst, find the size (in 512-byte sectors) of the device to be used:}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjWhhubh literal_block)}(h*$ sudo blockdev --getsz /dev/vdb1 33552384h]h*$ sudo blockdev --getsz /dev/vdb1 33552384}hjxsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jvhhhK7hjWhhubh)}(hHCreate the dm-dust device: (For a device with a block size of 512 bytes)h]hHCreate the dm-dust device: (For a device with a block size of 512 bytes)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjWhhubjw)}(hE$ sudo dmsetup create dust1 --table '0 33552384 dust /dev/vdb1 0 512'h]hE$ sudo dmsetup create dust1 --table '0 33552384 dust /dev/vdb1 0 512'}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhK?hjWhhubh)}(h.(For a device with a block size of 4096 bytes)h]h.(For a device with a block size of 4096 bytes)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjWhhubjw)}(hF$ sudo dmsetup create dust1 --table '0 33552384 dust /dev/vdb1 0 4096'h]hF$ sudo dmsetup create dust1 --table '0 33552384 dust /dev/vdb1 0 4096'}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKEhjWhhubh)}(hCheck 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]hCheck 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):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjWhhubjw)}(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 outh]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}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKKhjWhhubeh}(h]usage-instructionsah ]h"]usage instructionsah$]h&]uh1hhhhhhhhK3ubh)}(hhh](h)}(hAdding and removing bad blocksh]hAdding and removing bad blocks}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKWubh)}(hAt 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]hAt 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:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhjhhubjw)}(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 72h]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&]jjuh1jvhhhK]hjhhubh)}(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]hThese bad blocks will be stored in the “bad block list”. While the device is in “bypass” mode, reads and writes will succeed:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjhhubjw)}(h9$ sudo dmsetup status dust1 0 33552384 dust 252:17 bypassh]h9$ sudo dmsetup status dust1 0 33552384 dust 252:17 bypass}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKihjhhubeh}(h]adding-and-removing-bad-blocksah ]h"]adding and removing bad blocksah$]h&]uh1hhhhhhhhKWubh)}(hhh](h)}(hEnabling block read failuresh]hEnabling block read failures}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5hhhhhKmubh)}(hLTo enable the "fail read on bad block" behavior, send the "enable" message::h]hSTo enable the “fail read on bad block” behavior, send the “enable” message:}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohj5hhubjw)}(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_blockh]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}hjTsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKqhj5hhubh)}(huWith 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”:}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhj5hhubjw)}(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/sh]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}hjpsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKzhj5hhubh)}(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~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5hhubjw)}(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 writeh]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}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhj5hhubeh}(h]enabling-block-read-failuresah ]h"]enabling block read failuresah$]h&]uh1hhhhhhhhKmubh)}(hhh](h)}(h#Bad block add/remove error handlingh]h#Bad block add/remove error handling}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hAttempting 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]hAttempting to add a bad block that already exists in the list will result in an “Invalid argument” error, as well as a helpful message:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjw)}(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 badblocklisth]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}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjhhubh)}(hAttempting 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]hAttempting 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:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjw)}(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 badblocklisth]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}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjhhubeh}(h]#bad-block-add-remove-error-handlingah ]h"]#bad block add/remove error handlingah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h7Counting the number of bad blocks in the bad block listh]h7Counting the number of bad blocks in the bad block list}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(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:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjw)}(h-$ sudo dmsetup message dust1 0 countbadblocksh]h-$ sudo dmsetup message dust1 0 countbadblocks}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjhhubh)}(hWA message will print with the number of bad blocks currently configured on the device::h]hVA message will print with the number of bad blocks currently configured on the device:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjw)}(h%countbadblocks: 895 badblock(s) foundh]h%countbadblocks: 895 badblock(s) found}hj.sbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjhhubeh}(h]7counting-the-number-of-bad-blocks-in-the-bad-block-listah ]h"]7counting the number of bad blocks in the bad block listah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Querying for specific bad blocksh]h Querying for specific bad blocks}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjDhhhhhKubh)}(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:}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDhhubjw)}(h,$ sudo dmsetup message dust1 0 queryblock 72h]h,$ sudo dmsetup message dust1 0 queryblock 72}hjcsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjDhhubh)}(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:}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDhhubjw)}(h0dust_query_block: block 72 found in badblocklisth]h0dust_query_block: block 72 found in badblocklist}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjDhhubh)}(hBThe following message will print if the block is not in the list::h]hAThe following message will print if the block is not in the list:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDhhubjw)}(h4dust_query_block: block 72 not found in badblocklisth]h4dust_query_block: block 72 not found in badblocklist}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjDhhubh)}(hThe "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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDhhubeh}(h] querying-for-specific-bad-blocksah ]h"] querying for specific bad blocksah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hClearing the bad block listh]hClearing the bad block list}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hTo clear the bad block list (without needing to individually run a "removebadblock" message command for every block), run the following message command::h]hTo clear the bad block list (without needing to individually run a “removebadblock” message command for every block), run the following message command:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjw)}(h-$ sudo dmsetup message dust1 0 clearbadblocksh]h-$ sudo dmsetup message dust1 0 clearbadblocks}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjhhubh)}(hFAfter clearing the bad block list, the following message will appear::h]hEAfter clearing the bad block list, the following message will appear:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjw)}(h'dust_clear_badblocks: badblocks clearedh]h'dust_clear_badblocks: badblocks cleared}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjhhubh)}(hIIf there were no bad blocks to clear, the following message will appear::h]hHIf there were no bad blocks to clear, the following message will appear:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjw)}(h(dust_clear_badblocks: no badblocks foundh]h(dust_clear_badblocks: no badblocks found}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjhhubeh}(h]clearing-the-bad-block-listah ]h"]clearing the bad block listah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hListing the bad block listh]hListing the bad block list}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj,hhhhhKubh)}(hTo 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]hTo 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:}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj,hhubjw)}(h0$ sudo dmsetup message dust1 0 listbadblocks 1 2h]h0$ sudo dmsetup message dust1 0 listbadblocks 1 2}hjKsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhj,hhubh)}(h[If there are no bad blocks in the bad block list, the command will execute with no output::h]hZIf there are no bad blocks in the bad block list, the command will execute with no output:}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj,hhubjw)}(h,$ sudo dmsetup message dust1 0 listbadblocksh]h,$ sudo dmsetup message dust1 0 listbadblocks}hjgsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhj,hhubeh}(h]listing-the-bad-block-listah ]h"]listing the bad block listah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hMessage commands listh]hMessage commands list}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj}hhhhhKubh)}(hBBelow is a list of the messages that can be sent to a dust device:h]hBBelow is a list of the messages that can be sent to a dust device:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj}hhubh)}(h5Operations on blocks (requires a argument)::h]h4Operations on blocks (requires a argument):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj}hhubjw)}(h@addbadblock queryblock removebadblock h]h@addbadblock queryblock removebadblock }hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhj}hhubh)}(ho...where is a block number within range of the device (corresponding to the block size of the device.)h]ho...where is a block number within range of the device (corresponding to the block size of the device.)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj}hhubh)}(h"Single argument message commands::h]h!Single argument message commands:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj}hhubjw)}(h@countbadblocks clearbadblocks listbadblocks disable enable quieth]h@countbadblocks clearbadblocks listbadblocks disable enable quiet}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhj}hhubeh}(h]message-commands-listah ]h"]message commands listah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hDevice removalh]hDevice removal}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hCWhen finished, remove the device via the "dmsetup remove" command::h]hFWhen finished, remove the device via the “dmsetup remove” command:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjw)}(h$ sudo dmsetup remove dust1h]h$ sudo dmsetup remove dust1}hj sbah}(h]h ]h"]h$]h&]jjuh1jvhhhKhjhhubeh}(h]device-removalah ]h"]device removalah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Quiet modeh]h Quiet mode}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hOn 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]hOn 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:}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjw)}(h$$ sudo dmsetup message dust1 0 quieth]h$$ sudo dmsetup message dust1 0 quiet}hj>sbah}(h]h ]h"]h$]h&]jjuh1jvhhhMhjhhubh)}(hThis 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]hThis 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.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hBThe status of quiet mode can be seen by running "dmsetup status"::h]hEThe status of quiet mode can be seen by running “dmsetup status”:}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubjw)}(hO$ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block quieth]hO$ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block quiet}hjhsbah}(h]h ]h"]h$]h&]jjuh1jvhhhMhjhhubh)}(h7To disable quiet mode, send the "quiet" message again::h]h:To disable quiet mode, send the “quiet” message again:}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjw)}(hw$ sudo dmsetup message dust1 0 quiet $ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block verboseh]hw$ sudo dmsetup message dust1 0 quiet $ sudo dmsetup status dust1 0 33552384 dust 252:17 fail_read_on_bad_block verbose}hjsbah}(h]h ]h"]h$]h&]jjuh1jvhhhMhjhhubh)}(h5(The presence of "verbose" indicates normal logging.)h]h9(The presence of “verbose” indicates normal logging.)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h] quiet-modeah ]h"] quiet modeah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h "Why not...?"h]h“Why not...?”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hscsi_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]hscsi_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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hndm-flakey fails all I/O from all block locations at a specified time frequency, and not a given point in time.h]hndm-flakey fails all I/O from all block locations at a specified time frequency, and not a given point in time.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM"hjhhubh)}(hXWhen 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]hXWhen 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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hjhhubh)}(hThis 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]hThis 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).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hjhhubeh}(h]why-notah ]h"] "why not...?"ah$]h&]uh1hhhhhhhhMubeh}(h]dm-dustah ]h"]dm-dustah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj$error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjTjQjjj2j/jjjjjAj>jjj)j&jzjwjjjjjjjju nametypes}(jjTjj2jjjAjj)jzjjjjuh}(jhjQjNjjWj/jjj5jjj>jjjDj&jjwj,jj}jjjjjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.