How can I simulate a failed disk during testing?

前端 未结 7 1918
情书的邮戳
情书的邮戳 2020-12-08 01:11

In a Linux VM (Vmware workstation or similar), how can I simulate a failure on a previously working disc?

I have a situation happening in production where a disc fai

相关标签:
7条回答
  • 2020-12-08 01:58

    Linux kernel provides a nice feature called “fault injection”

    echo 1 > /sys/block/vdd/vdd2/make-it-fail
    

    To setup some of the options:

    mkdir /debug
    mount debugfs /debug -t debugfs
    cd /debug/fail_make_request
    echo 10 > interval # interval
    echo 100 > probability # 100% probability
    echo -1 > times # how many times: -1 means no limit
    

    https://lxadm.com/Using_fault_injection

    0 讨论(0)
提交回复
热议问题