It happens when you turn your computer off (sometimes, I'm not sure but I think it also depends on type of connection because sometimes I get that message with a usb but not with my external HDs - it might possibly depend largely on format). I had that often with my PC so you may have been lucky not seeing it on a win machine.
But for some odd reason some usb things stopped showing on your desktop even if you had it set in preferences. To get all removable drives to appear on the desktop:
Go to the top menu bar, Finder > Preferences > General. For "Show these items on the desktop", put a check for "External disks".
I have found that often (and it's usually the older cameras, scanners and mp3 players) that don't show on the desktop or in finder (hopefully you do know how to eject). Most often anything shows up in Disk Utility (Command (windows key) + Shift + U), Image capture (applications folder - often will show cams, iphones, ipods and scanners etc)
If it shows in Disk Utility, then you should do a repair disk on it and often that is part of the problem.
There are also free or paid utilities that will help with this. There are some who have also written scripts to do this automatically either before shut down or when the computer sleeps
You also can often leave your computer on. But if you have energy saver set in System preferences then that also might be the problem...