James G. Sack (jim) wrote:
Menachem Shapiro wrote:
B"H
Hello
Does anyone know of a way to simulate S.M.A.R.T. errors on my hard
disk? Maybe get the drive to report an error, even though it doesn't
have one?
I want to confirm that S.M.A.R.T. monitoring is working properly, and
maybe setup a script that will email me if a S.M.A.R.T. error occurs.
I looked for this (and/or /related) sort of thing a few years ago, and
didn't find anything (reasonable) at that time.
I don't think there's any specific way to do that which would be truly
realistic, short of expensive fault-injection (disk-emulation) hardware.
Certainly you can test the triggering and notification parts by
substituting your own data in place of output from smartctl.
One way to simulate it would be to write a hook into the ide driver and
provide a /proc interface to it. Then by writing different codes into
the /proc interface you could simulate different faults. I haven't
looked at the source code for that part of the kernel yet so maybe it's
already there.
Or instead of writing to something in /proc do a complete relay of all
ATA commands and responses to a user space program that can inject fault
signals. I'm not sure of an easy way to do it.
Gus
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list