Simulate a faulty block device with read errors?

前端 未结 4 1207
离开以前
离开以前 2020-12-08 16:17

I\'m looking for an easier way to test my application against faulty block devices that generate i/o read errors when certain blocks are read. Trying to use a physical hard

4条回答
  •  余生分开走
    2020-12-08 17:11

    The easiest way to play with block devices is using nbd.

    Download the userland sources from git://github.com/yoe/nbd.git and modify nbd-server.c to fail at reading or writing on whichever areas you want it to fail on, or to fail in a controllably random pattern, or basically anything you want.

提交回复
热议问题