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:
Use of a 'Y' cable (a cable with two A-plugs) is prohibited on any USB peripheral. If a USB peripheral requires more power than allowed by the USB specification to which it is designed, then it must be self-powered.
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 hosts (e.g. two different computers, a computer and a hub etc.) can lead to multiple electrical problems:
One of the hosts may be unpowered while the other one is powered on. This will result in powered host pushing current to the unpowered one in the wrong direction, possibly resulting in damage.
Even if both hosts are powered, one will provide a slightly higher voltage than the other, resulting in a problem similar to #1, perhaps less severe.
If you're extremely "lucky", you may get two PCs with poorly isolated PSUs connected to different Mains (120V or 240V) networks. Connecting those with a common-ground cable (which a Y-shaped USB cable is) will zap both computers instantly. Though in this case I would be more concerned about electrical safety in general rather than about Y-cable use.
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.