How do you know it's the hard drive that's faulty? You need to test it with the drive manufacturer's diagnostic software for DOS which loads from a bootable CD.
For WD hard drive, the link to the CD image is here: http://www.smartestcomputing.us.com/topic/63494-looking-for-western-digital-data-lifeguard-iso/