Skip to contentSkip to conversation

Add set bad lba function in md-faulty module.

DISCUSSION majianpeng 2 participants 3 messages May 15, 2012 – May 18, 2012 MD RAID

lore
Share & tools
lore

majianpeng

author
#0 lore raw

Hi all:
In order to test md code, sometime we need simulate read/write harddisk error.
Using hdparm --make-bad-sector to simulate read error.But I did not find way of simulating write-error. I tested md-faulty module, it can do this.But it is not provide the function link hdparm --make-bad-sector,which did not set lba. Using hdpamr --make-bad-sector to simulate read error can cause some problem.
It will cause ata commnd reset,disk reset and so on.It take too log time.
So I think add a function in md-faulty which can set read/write lba.
How about ?

--------------
majianpeng
2012-05-15

#1 lore raw
Quoted 10 lines · majianpeng

Hi all:
In order to test md code, sometime we need simulate read/write harddisk error.
Using hdparm --make-bad-sector to simulate read error.But I did not find way of simulating write-error. I tested md-faulty module, it can do this.But it is not provide the function link hdparm --make-bad-sector,which did not set lba. Using hdpamr --make-bad-sector to simulate read error can cause some problem.
It will cause ata commnd reset,disk reset and so on.It take too log time.
So I think add a function in md-faulty which can set read/write lba.
How about ?

How about using an iscsi at localhost? Export disk via ISCSI target, connect to it with initiator. With iptables and open-iscsi settings you can precisely control error behavior and imitate all kinds of errors (including timeouts).

author
#2 lore raw
In reply to majianpeng

Thanks. In fact, using md-faulty also do that,but must do more steps. So I think add it in md-faulty.

------------------
majianpeng
2012-05-18

-------------------------------------------------------------
发件人:George Shuklin
发送日期:2012-05-17 19:49:26
收件人:majianpeng
抄送:linux-raid
主题:Re: Add set bad lba function in md-faulty module.

Quoted 10 lines · majianpeng

Hi all:
In order to test md code, sometime we need simulate read/write harddisk error.
Using hdparm --make-bad-sector to simulate read error.But I did not find way of simulating write-error. I tested md-faulty module, it can do this.But it is not provide the function link hdparm --make-bad-sector,which did not set lba. Using hdpamr --make-bad-sector to simulate read error can cause some problem.
It will cause ata commnd reset,disk reset and so on.It take too log time.
So I think add a function in md-faulty which can set read/write lba.
How about ?

How about using an iscsi at localhost? Export disk via ISCSI target, connect to it with initiator. With iptables and open-iscsi settings you can precisely control error behavior and imitate all kinds of errors (including timeouts).