|Check the power connector to the drive. |
I had a drive that did this and the fault was a lose power connector. Tightened up the power connector and the problem disappeared.
If it is an ATA drive the sockets in the Molex connector can get spread and be a bit lose Just squeeze then together gain and everything should be fine. Be careful though, don't squeeze them so tight that the pins on the hard drive wont go in.