A simple script which would fake media error back the upper level. First read write files and list block numbers being read/written, and then specify block number on which media error has to be created. IO will fake fail, btrfs can be tested for these error conditions. You won't be able to test for data consistency. Works on any SCSI device no need of LVM or any IO special kernel module. attached script is still a rough cut. Thanks, Anand