4 ms·
nbdkit memory 10G --filter=error error-rate=1% ... and then nbd-loop-mount that as a block device and create your filesystem on top. Notes: We're working on
by rwmj 4y ago
nbdkit memory 10G --filter=error error-rate=1%
... and then nbd-loop-mount that as a block device and create your filesystem on top.
Notes:
We're working on making a ublk interface to nbdkit plugins so the loop mount wouldn't be needed.
There are actually better ways to use the error filter, such as triggering it from a file, see the manual: https://www.libguestfs.org/nbdkit-error-filter.1.html https://www.libguestfs.org/nbdkit-error-filter.1.html
It's an interesting idea to have an "evil" filter that flips bits at random. I might write that!
- antongribok 4y agoHow does this compare with dm-flakey [0] ? [0]: https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/dm-flakey.html https://www.kernel.org/doc/html/latest/admin-guide/device-ma...
- rwmj 4y agodm-flakey runs inside the kernel so is going to be faster. With nbdkit + NBD loop mounting there's a bit of overhead going through a Unix socket, which is avoided by using ublk + nbdkit plugins, but you still have to go out to userspace for each device access. The advantage is you can write plugins as regular code in lots of different programming languages, with a stable API and ABI: https://www.libguestfs.org/nbdkit.1.html https://www.libguestfs.org/nbdkit.1.html So it's a lot easier to experiment or write plugins for odd devices. Also our sparse RAM disk supports huge disks (up to 16 exabytes IIRC, 2^63-1 bytes whatever that is).
- Dwedit 4y agoSuddenly I'm reminded of the time someone made a Bad Internet simulator (causing packet loss or other problems) and named the program "Comcast".
- klabb3 4y agoI love it.