Saturday, July 11, 2015

Raspberry Pi and external USB drives

OK, for no other reason than I can, I wanted to add an external hard drive to my test Pi (I have three Pis - two of the older Model B and one of the latest version).

The test Pi is a Model B in a blue case (to identify it easily!). Originally, I considered moving the Root partition to the hard drive and just booting from the SD card as this is supposed to be quicker, however, I rarely reboot the Pi and to be honest, they don't take very long to get up and running anyway.

So the plan was to simply connect the USB HDD to the Pi and use the extra space for whatever my latest crazy idea may be. All the spare USB HDDs I have lying about are those ones which don't have their own power supply - i.e they are those "portable" type ones with two USB connectors which need to be plugged in to a USB source to get the power needed to run the things and to take the data to and from.

From my own experiments, some research and of course common sense, I knew that the Pi - with its two USB ports (one of which has the wifi adapter in it anyway) would not have sufficient power to run the drive - and that I would need a powered USB hub to do this.  Luckily, I happen to have two spare!

Armed with all the bits I needed - Pi and power supply, powered  hub and power supply, connections and the USB HDD - I connected it all together and fired things up.

Looking good - lights all on and I could ssh into the Pi.
However, nothing showing under the "dmesg" command to suggest the USB HDD was there.
Perhaps faulty kit? After swapping the powered hub for my other one, I repeated the command - still nothing.  Although the USB HDD worked when connected to my PC, maybe it was faulty? It was, after all, just an old SATA 2.5" drive from a laptop in a cheap caddy. So I swapped the HDD for a "proper" one - a Maxtor as it happens. This time, when I fired things up, I got a clicking noise from the drive whenever access was tried. As a techie, I know this means either the drive is failing (which was unlikely) or a lack of power.....

Surely I had checked all the kit - tried different powered hubs - and no luck. Then, as I was pulling it all apart, I just happened to pull out the powered USB hub power supply and casually looked at the power output. 1000mA. That doesn't sound a lot to me I thought. I know these external drives need a fair bit of power. This was the power supply from the more generic of the two hubs I have, so I dug out the other power supply - 2000mA, twice the power.

Using the more powerful power supply, I connected all back up and .... hurray!  Success!

Moral:  Be wary of using cheap, generic kit with the Pi. Yes, some works fine but these things are very low power and need all the help they can get to ensure stable running.

No comments: