# Is it possible to use bad\_blocks to simulate write\_error and activate hot-replace?

- From: Apple Yin \<hidden\>
- Date: 2015-01-20 08:25:58 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2015/01/6628816
- Thread: https://ratatoskr.run/linux-raid/2015/01/6628816/t.md

```text
I want to test hot-replace when a write error is recorded in a
bad-block log. Here is my steps:

1. create raid5 with 3 disks (sdb sdc sdd), and 1 spare (sde)

2. echo 2097152 512 > /sys/block/md192/md/dev-sdb/bad_blocks  /* set 1
badblock from 1G of sdb*/

3. dd if=/dev/zero of=/dev/md192 bs=1M count=1024 seek=2048 /* from 2G of md */
    dd if=/dev/zero of=/dev/md192 bs=1M count=1024 seek=2000 /* near to 2G */


No write error happen, sdb is not marked as want_replacement and not
start the rebuild. Anyone help ?
```
