Closed Knogle closed 1 month ago
Okay my bad, now it works fine! Didn't clean up old loopback devices.
That's a useful feature. How does it achieve one or more bad blocks in a loop device?
Are they contiguous bad blocks or single random location bad blocks?
That's a useful feature. How does it achieve one or more bad blocks in a loop device?
Are they contiguous bad blocks or single random location bad blocks?
Hey. Yeah it's quite advanced now.
This script simulates bad blocks using the following steps:
Loop Device Setup: It sets up a loop device from a file, which simulates a block device using the losetup
command.
Faulty Block Simulation: When using the faultymount
or faultymountfs
options, the script creates a loop device and simulates faulty blocks by setting up a Device Mapper (DM) table using the dmsetup
command. The faulty blocks are passed as arguments (e.g., block numbers or ranges).
500-510
) and creates the DM table. The valid blocks are mapped normally, and the specified faulty blocks are mapped as errors, which effectively "corrupts" those blocks.So you can manually specifiy specific blocks to be bad.
faultymount 1G 500,1000 Create a 1G-sized loop device with blocks 500 and 1000 faulty."
Or a whole range of blocks.
faultymountfs 1G 500-510 Same as above but also create a filesystem and mount it, blocks 500 to 510 faulty."
But don't forget, in this case write to the /dev/mapper
device, not the underlying loop device directly.
https://github.com/Knogle/mount-loop
Are there maybe any more functions that could be useful?
Thanks for the detailed description, I think I'll fork that and start using it for my own tests.
I can't think of any new features at the moment, but if I do I'll be sure to let you know.
Ahoy! I hope you’re doing well.
I’ve modified my
mount-loop
script to create loopback devices with a random number of bad blocks. When I usedd
to write data to every block, it eventually encounters a bad block, resulting in the following error:However, when I use
nwipe
, it completes without any issues. Doesnwipe
only detect bad blocks if they fail during the wiping process?