I have been advised to use a USB Y cable to power a portable hard drive from 2 ports since it could not draw enough power from a single port. Is there any danger of overloading the drive this way?
The USB specification prohibits the use of Y-cables:
But the real-world said "to hell with your silly rules" and uses Y-cables all the time.
Technically, there is pretty much zero risk of anything bad happening. Just don't use Y-cables via an unpowered USB Hub. Plug the connectors straight into the computer's USB ports.
"is there any danger of overloading the drive this way?"
Using a Y-cable doesn't increase the Voltage, it only makes more current available, so it's all good. The drive will take as much current as it needs.
You are far more likely to damage (the contents) of a drive by running it under-powered. Nothing worse than write operations failing mid-way. So I implore you, use the Y-cable ;-)
The Y cable is forbidden by the USB specification for a reason. Connecting the A-plugs of an Y cable into two different host ports (e.g. two different computers, a computer and a hub etc.) can lead to multiple electrical problems:
If you make sure to connect both A-plugs to the same USB host, using an Y-cable is fine (I have one myself). Don't worry about over-powering the drive, it will take just as much current as it needs.
The usual problem with trying to use two DC power supplies in parallel is that one will supply much more current than the other due to slight differences in voltage. This isn't usually a problem with USB as the ports have a maximum rated current draw after which they will not supply any more current. So, while one port may produce the bulk of the current required, it won't produce "to much" current.
This, of course, assumes the USB devices supplying the power are working to spec. There are devices out there that are poorly made and could have issues like burning out. These problem devices are easier to find in the phone charger market.
The cable used for these usually only has the power lines hooked up. If data is possible, it's usually only available on one connection and the Y-adapter should indicate which that is.
As others have mentioned, Y-adapter cables that enable this are not technically USB cables.
It would be more dangerous to use the incorrect non Y cable and have the drive be underpowered.
Many laptop sized portable drives have no AC power adapter, to make up for that they use a USB cable that has two on one side so it can draw more power than one USB port can provide.
Only one of the two on the double side will have its data pins connected, the 2nd connector only has the power pins connected.