In reality we do not recommend you "smack" your hard drive or other system components, but sometimes a little love tap or two can fix odd problems. Recently we received an e-mail from a MacFixIt reader who wrote in with a fix he found for his Western Digital MyBook external hard drive that had stopped working. The drive would appear to start mounting or otherwise be recognized by the system, but then seem to hang and not be recognized.
This problem started happening after the system had been using the drive successfully for a while, and had performed numerous Time Machine backups to it. While hard drives can fail at times for odd reasons, in this instance it turned out to be a problem with the drive's enclosure.
Apparently the power button on the MyBook enclosure can get stuck, and since holding the power button on many devices is a way to reset them or otherwise send custom commands to the firmware, this could cause the MyBook to power up but then stop communicating properly with the computer.
The quick fix for this is to turn off and unplug the MyBook, and then give it a few sharp taps around the power button to dislodge it. Once this has been done, plug it back in and start it up again, and hopefully the device will be working. Be sure if you tap the drive that you do so firmly but not violently. While hard drives park their heads when powered down, a violent shock can still cause physical damage. I would recommend placing the drive against a firm surface like a table and then tapping it firmly with one or two fingers, as if you were striking a piano key loudly.
In addition to buttons getting stuck, drives may also stop working because of power problems and connection problems. If the drive is not getting enough power (especially true with bus-powered devices) then the device may unmount and fail. Therefore, plug it in if you have a power supply for it (many bus-powered drives ship with an optional one).
In addition to ensuring the drive is getting adequate power, try checking the cables for the drive by swapping them out. Connect the drive directly to the Mac and avoid daisy-chaining it to other devices.
Lastly, try resetting the device, since a firmware fault could cause communications and power management errors. Check with the manufacturer on how to do this, but it usually involves unplugging the device for a set amount of time, and pressing a combination of buttons or a small, hidden reset button on the device.