[DRBD-user] how to inject disk block errors?

Greg Freemyer greg.freemyer at gmail.com
Wed Apr 14 22:35:48 CEST 2010

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Wed, Apr 14, 2010 at 3:02 PM, Joseph L. Casale
<jcasale at activenetwerx.com> wrote:
>>If there is some software to or package which you have used to inject disk block errors,
>>I would appreciate knowing about it.  I want to see how my system handles disk
>>errors.
>
> dd?
> Set a seek if you want it somewhere besides the start of the disc.
>
> FWIW, drbd won't know jack about this, this is a filesystem thing and
> drbd will happily replicate what you tell it to, which is "the whole block
> device defined"
>
> By the time the filesystem realizes there is damage, it will have long been
> replicated...

hdparm has an option to fail a sector.

It does it by overriding the default crc value and putting in a
incorrect one instead.

Then every time that sector is read you will get a media error.

When you're done testing, you can use hdparm to write out valid data
again, so the issue is not permanent.

fyi: In a semi-production environment you obviously want to save the
sector contents in advance and write it back out at the end.

dd with the offset option should be able to handle those 2 tasks.

Greg



More information about the drbd-user mailing list