The problem appears to be across OS Xs. I am still on 10.6.8 on my iMac. I have a a WD 1TB MyBook (Time Machine) connected by USB 2.0 to iMac, and a powered USB 2.0 hub, through which I connect an older 320 MB Iomega used for image storage redundant backup. I've unchecked "put hard disk(s) to sleep when possible." The iMac is set to go to sleep after 20 minutes without activity. A BackUPS is connected by USB directly to iMac.
At unpredictable times, I will return to the computer and find that the two external hard drives are neither on the desktop nor in the finder. Almost everything else seems to work. However, when I try to restart or shutdown from the apple pulldown menu, everything disappears from my desktop (except the desktop picture) and the iMac does not restart or shutdown. The standard drill is that I manually shut down (button on back of iMac) and wait 15 seconds or often much longer, manually turn the iMac on. At this point the external drives reappear. I then run disk utility to repair permissions on the iMac internal HD. Everything works fine for a while.
Sometimes, I will return to the computer and find a "disk improperly ejected" message that will disappear seconds after I see it, or one that stays there until I close it. This can happen first thing in the morning, middle of the night, or sometimes during the day.
Sometimes I will check in the middle of the night and see that the iMac is on. I have never found out why, although it might be TM. On some such occasions, as indicated above, the external HDs have disappeared and the apple pulldown shutdown acts as indicated.
When everything is working there is no sign of trouble. I've used verify disk on the internal HD and it passes.
As far as I can tell, I have one option I haven't tried yet. I've just set the iMac to never go to sleep to see if that helps.
In the meantime, from the 17 pages of comments and the numerous other threads including reports of the same or similar problems, it looks strongly like this is an Apple software problem across hardware and generations of operating systems. I agree with those who say Apple should fix it. One of the frustrating things about Apple is that there is no assurance that it will look at these discussions, do anything, much less let us know that it has done something.