Create a hard disk error on linux
I would like to create hard drive errors on my linux box - so that I can test that the application I'm writing performs correctly when there are uncorrectable errors.

I have an application from a hard disk manufacturer that will create bad sectors on a drive, but it is windows only - and would involve much plugging and unplugging of disks, as I am on a linux platform.

I have seen this previous post: http://stackoverflow.com/questions/1870696/simulate-a-faulty-block-device-with-read-errors but cannot use this as I don't have dmsetup available.

I know I can use dd to corrupt files, by writing random data over files, but I would like to create a bad sector, not a readable, but corrupt file.

Any tips much appreciated

Thanks!
 
Create a hard disk error on linux
===

I would like to create hard drive errors on my linux box - so that I can test that the application I'm writing performs correctly when there are uncorrectable errors.

I have an application from a hard disk manufacturer that will create bad sectors on a drive, but it is windows only - and would involve much plugging and unplugging of disks, as I am on a linux platform.

I have seen this previous post: http://stackoverflow.com/questions/1870696/simulate-a-faulty-block-device-with-read-errors but cannot use this as I don't have dmsetup available.

I know I can use dd to corrupt files, by writing random data over files, but I would like to create a bad sector, not a readable, but corrupt file.

Any tips much appreciated

Thanks!
 