[dm-devel] Simulating faulty disk

Yathindra ydev at cs.utah.edu
Fri Oct 21 15:00:03 UTC 2011


Ok :)  Bryn is there a more elaborate document which shows simple examples
to work with device mapper. For a newbie like me it would be really helpful.

Thanks,
Yathi

On 10/21/2011 8:56 AM, Bryn M. Reeves wrote:
> On 10/21/2011 03:47 PM, Yathindra wrote:
>> dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
>> /dev/sdb 0 500"
>> dmsetup create f0 --table="0 `blockdev --getsize /dev/mapper/d0` flakey
>> /dev/mapper/d0 0 9 1"
>> mkfs -t ext3 /dev/mapper/f0
>> ...
>> ...
>> ext2fs_mkdir: Attempt to read block from filesystem resulted in short
>> read while creating root dir
>>
>> Can we even mount such a device ?
>
> It's a flakey device :)
>
> With that table you'll have a device that is failing write I/Os for 1s 
> in every ten. If that coincides with mkfs trying to write to the 
> device it will create a corrupted file system.
>
> Depending on what you are trying to test you may want to put data on 
> the device first.
>
> Regards,
> Bryn.




More information about the dm-devel mailing list