42

I am going to buy a 7-port USB 3.0 hub, and connect 7 portable HDDs to it, in order to build a RAID 6 array. The hub comes with an upstream micro-USB 3.0 type B port, along with an auxiliary power adapter rated at 5V 2A (micro-USB 2.0 type B connector).

USB hub

Each 2.5 inch HDD can easily consume 5V 0.9A which is the maximum for a single USB 3.0 port. And now I am going to connect 7 of them to all available ports.

My questions are:

  1. Are the power from the upstream USB port (0.9A) and the auxiliary port (2.0A) combined? I am confused, because I can always plug another hub into this one, and cascade this USB network -- and that hub can be either host-powered or self-powered. How does the power flow in this case? enter image description here
  2. If a 2.5" HDD receives less than its required power (2A / 7 = 286mA), will it work at lower speed or won't work at all? Does it try to draw more power and overload the 5V 2A adapter?
  3. Can I replace the stock power adapter with higher current ones, e.g 5V 10A?
  • 4
    Although I am not interested in using it for RAID, I have been searching for over 2 years for a powered USB 3.0 hub that can actually handle 6 external 2.5" HDDs without error. I've tried about a dozen of them so far (from a variety of manufacturers, many of them highly recommended), and each one had problems. The biggest issue is the hubs causing drives to lose power or USB connectivity when another drive is inserted. This happens even though the hubs are provided with more than sufficient power via AC adapters. – RockPaperLizard Apr 6 at 4:33
  • 2
    The "correct" organization would be a balanced tree. The first N layers contain only hubs; all disks are at the bottom layer. This guarantees all disks have the same bandwidth and power. But as noted, 286mA/1.4W isn't enough power for spin-up. – MSalters Apr 6 at 8:05
  • 2
    IF the real question is "which is the best (and cheapest) way to grow the file server into hundreds of TB in the future?" Perhaps time to look for a used/refurbished FC Storage/SAN. Used/refurbished server are already dirt ship. But any thing scale to hundreds of TB, Won't be "cheap". Cloud will be a good alternative especially if you didn't take AC, and Power equipment UPS and power consumption into account. – xdtTransform Apr 6 at 9:11
  • I would recommend using Amazon/Google pricing calculator. And do not expect to be able to buy a house for less than a few mounth rent. – xdtTransform Apr 6 at 9:16
  • 1
    Using a USB connection scheme would defeat the major purpose of RAID - redundancy. Any single point of failure on the array can result in multiple concurrent errors and consequent failure. The question should be 'Is there any way to make USB suitable for RAID?' The answer would be 'Only by having multiple independent USB controllers in the host and directly connecting the drives.' The SATA alternative proposed would likely have fewer points of failure as this would be the native interface of the type of disks proposed and avoid the USB translation layer. – Pekka Apr 8 at 9:36
97

This is a terrible idea; don't do this!

With electronics, total power in always equals total power out. You have two power sources: up to 2 A from power supply and 0.9 A from upstream port, that's up to 2.9 A total. What happens if drives try to pull more than that?

  • If the power supply is of good quality, it won't provide more than its rated 2 A and (at least some) drives won't spin up/will stop abruptly.
  • If the power supply is not reliable, it will catch fire.

With daisy-chained hubs:

  • If hubs have a diode that prevents backpowering, things get confusing: the power supply of the first hub powers all hubs down the chain, but the last one powers only the last hub. This is super unreliable.
  • If they don't, all power supplies are shared between all hubs. This would be preferable.

What's more, HDDs will draw significantly more than rated current for a moment when they spin up. And they spin up as soon as they get power, i.e. simultaneously. Servers deal with this by starting drives one by one in intervals. You can't do this here because you don't have an advanced drive controller; each drive has one in its integrated SATA-to-USB adapter. More powerful power supplies will improve things, but it will still be super unreliable.

Power issues aside, this is still a terrible idea

I don't know how you intend to use this peculiar RAID array, but it's fundamentally flawed.

RAID is not about backup, RAID is about reliability. If you want protection against data loss, RAID is not what you need. So I assume the goal of this project is reliability and availability. Your array is very unreliable, so it doesn't serve its sole purpose.

Once a single drive fails or drops from array for whatever reason, it has to be brought back into the array and rebuilt. Rebuild of a single dozen-TB drive will take days. You want to use 2.5" drives, so we're probably in 500 GB - 5 TB range. Such drives will take between three hours and two days, probably. Now consider this:

  • Your power solution is sketchy
  • USB is not meant for permanent attachment - drives do disconnect accidentally every now and then
  • We're not sure how well this hub will deal with plenty of drives
  • These drives either take plenty of desk space with a rat's nest of cables or are neatly stacked, ready to be knocked down
  • Neither of them was designed to work with vibrations amplified seven-fold (drive vibrations travel through case, desk, etc.)

With RAID 6 you can lose two drives without data loss, including drives that are pending rebuild. Considering these problems I wouldn't be surprised if you'd be losing drives faster than you can rebuild them. This will be a disaster waiting to happen.

Solution

You need a DAS (direct-attached storage). It's an enclosure in which you can put your drives, configure them as an array and have them presented as a single device. RAID is entirely managed by the DAS itself. NAS (network-attached storage) is also an option, but it will be available over the network rather than directly attached.

DAS and NAS devices are built with multiple drives in mind. Power problems are already solved for you, and disks are attached using SATA connectors and screwed in (3.5" disks are preferable, but you could go with 2.5" + adapters if you prefer them for some reason). Using drives designed for NAS is recommended.

This will cost a lot more, but it will work reliably which is the whole point.

You can reduce the price by buying external drives (they are cheaper than internal ones) and taking them out of their USB enclosures ("shucking"). But you may lose the warranty, you get drives that are not certified for arrays (vibration problem) and you must know what to buy: for example some 2.5" portable drives have USB ports soldered directly into their PCB, without any SATA port.

Some popular DAS brands are TerraMaster and Drobo.

TL;DR: Don't do this.

If you're on a tight budget, scale down and go for a DAS.

| improve this answer | |
  • 1
    I am a newbie to enterprise network administration. What I am currently doing is playing around and see which is the best (and cheapest) way to grow the file server into hundreds of TB in the future, while the server board only has a limited number of SATA ports. Aside from the RAID enclosure, currently I can see only 2 ways to deal with it: USB or SAN (iSCSI - to present the storage of a PC as a single HDD over the network to a centralized server). The USB approach seems to be a terrible idea now. Is there any other solution to this other than RAID box and SAN? – Livy Apr 5 at 9:00
  • 2
    @Livy Add a HBA to the server to provide more ports maybe? Sorry, I'm not an expert in this matter. You could ask this question on ServerFault.com (or maybe it already has an answer). – gronostaj Apr 5 at 13:55
  • 2
    @Livy SATA ports is the cheap part of storage. The expensive parts is backups and integrity. If you need storage in the hundreds of terabytes, call someone that sells storage solutions. – vidarlo Apr 5 at 19:13
  • 21
    @Livy, if you're looking at hundreds of TB of storage, you're looking at enterprise-grade parts: rackmount server cases with hotswap drive bays, SAS drives, etc. Anything less is just asking for continuous problems. (I'd be amazed if your proposed USB RAID system has an uptime of even 50%.) – Mark Apr 5 at 21:58
  • 3
    @MSalters That chassis is definitely hot swap (on all disks and fans). RAID without hot swap is just useless for anything else but your home use, unless your users can accept regular downtime (and with 60 disks, that would be very regular downtime IMHO). – jcaron Apr 6 at 9:35
7

This very much seems to be an XY problem. What you're actually trying to achieve based on comments is scaling up storage capacity for a file server in an inexpensive way.

The issue here is that USB is horrendous for any situation where reliability is important for a couple of reasons:

  • Power distribution over USB is generally problematic. You can mitigate this by only using powered hubs and powered peripherals, but that doesn't solve any of the other issues.
  • The 'bus' is asymmetrical from a latency and efficiency perspective. The further down the chain of hubs something is, the worse it's latency and throughput will be. This can kind of be mitigated by utilizing a balanced tree topology so that everything is at the same nesting depth, but that's not exactly trivial, especially since the USB ports on most computers are actually connected to hubs internally themselves and not directly to the host controller, and it's also not exactly cheap.
  • USB connectors are actually rather mechanically unstable. This is actually really important for the original intended use of USB so that you don't damage the ports when you trip over a cable, but it's a very bad thing for storage systems where reliability is needed.
  • It's very easy to trigger a bus reset by accident. This isn't an issue for the input devices USB was intended to be used with, but it's a serious problem for storage devices (seeing link resets for SCSI or SATA devices is one of the times you start replacing hardware if you're doing things right).
  • Because of how the MSC and UAS standards work, you have t reinitialize the whole device every time you have to reset the bus, which in turn can cause all kinds of nasty behavioral problems when dealing with a RAID array of any type.

There are a few 'correct' approaches to this depending on exactly how much you can spend:

  • Look into getting some SATA Port Multipliers (essentially, these are like USB hubs for SATA devices). You will need support in the OS for this to work, but it's probably the least expensive option that's likely to be sufficiently reliable (just don't chain the port multipliers, it technically works but it causes serious performance issues in most cases).
  • Just get a proper SAS HBA for the file server. SAS controllers work just fine with SATA disks (they have to) but are far more efficient than SATA controllers and usually have more ports (the small ones will typically have 8 ports). If doing this, put the server's OS on the SATA connectors on the MB. If you have to keep this as a specific system, this is what I would do.
  • Get a dedicated NAS system. For a good one, you'd e looking at maybe 4-5 digits in terms of cost, but it would probably outlast whatever else you have, and would almost certainly scale well beyond what you actually need. FreeNAS is the OS I'd suggest here (iXsystems, the company backing FreeNAS, does reasonably priced semi-custom systems that are high-end enterprise quality). From there, you can either use iSCSI to expand the file server's storage, or you could just use the NAS directly.
  • Buy a bunch of small inexpensive systems, throw a big storage device in each, and then set up a clustered filesystem. GlusterFS would be my specific recommendation here (as long as you don't need really fast storage, you can throw together individual GlusterFS nodes for under 500 USD each). This will give you the best long-term scalability (it can easily go into the thousands of TB range without issue provided your networking hardware is good), but puts significant limitations on other choices you might make about your infrastructure. I've done this before myself with both Intel NUC systems and Raspberry Pi's.
  • Shell out probably hundreds of thousands on a proper SAN. Unless you're dealing with a big company, just don't, it's usually a waste.
| improve this answer | |
4

The hub, as any USB device, is either "bus" or "self" powered.

Devices are enumerated normally, and come up in configuration 0, where no interfaces are implemented and power is limited to 100 mA.

The OS may only enable configurations with higher power requirements if the power budget allows.

A bus powered USB 1.1 or 2.0 hub asks for 500 mA for its working configuration, which is enough to give 100 mA each to itself and four downstream devices (which is why USB hubs always have four ports), and downstream devices are powered only when that request was granted.

A self powered USB hub asks for 4 mA, which is pretty much a symbolic value -- this configuration uses less power than the inactive configuration, so it is always inside the power budget. The hub must refuse the configuration switch if the power adapter is not connected.

Hubs offer both self-powered and bus-powered configurations, and the OS will try them in turn. If the power adapter is not present, the self-powered configuration is rejected, and the OS checks if the power budget is sufficient for a bus-powered configuration.

So, in a tree with an arbitrary number of hubs, there is either enough power for all devices, or there is a device for which the OS knows that the power budget does not allow activating a "working" configuration, which causes a message to be displayed in the UI.

A seven port USB 1.1 or 2.0 hub consists of two four port hubs, where one is downstream of the other, so insufficient power to that hub would leave four downstream ports completely unpowered, and the OS would request the user to plug in the hub's power supply.

With USB 3.0, the numbers change a bit because it is now possible to request more power, but the general idea remains the same: if the power budget doesn't allow it, devices will not be activated.

The hub is aware that the total power budget for its downstream ports is 2 A, and reports that fact to the OS. The OS will refuse to activate more disks than that budget allows, so expect only a few of the disks to spin up.

In theory, the disks could attempt to start without permission, which would be a violation of the USB specification. What happens then depends on whether the hub actively limits port power. I would not entrust data to any disk that does not wait to be explicitly switched into an active configuration.

| improve this answer | |
  • 4
    "The hub is aware that the total power budget for its downstream ports is 2A, and reports that fact to the OS." - there is a lot of misleading information in this post like this.Hubs are not aware if anything, and don't report anything of this sort. This is highly theoretical post. In reality 90% of hubs report fake status as "self powered hub" even if they are connected to no power, and the entire theoretical scheme breaks down. – Ale..chenski Apr 5 at 20:22
  • 2
    "which is why USB hubs always have four ports" - not true. There are individual hub controller ICs with 7 ports, see superuser.com/a/1122852/620011 – Ale..chenski Apr 5 at 20:24
  • 1
    "In theory, the disks could attempt to start without permission", - in practice, HDD gets connected to USB over a IC that bridges HDD interface (SATA, PATA) to USB. The bridge can be connected to any HDD of any data capacity and power. Bridges cannot have this information unless the HDD comes out of reset and spins up. If fact, there is no such info at all, because HDDs are supposed to be connected to practically unlimited internal power of PC. During spin up many older HDDs would consume 1.5 - 2 A peak currents, and the entire hubs would die, which is/was a very frequent problem. – Ale..chenski Apr 5 at 20:44
  • 1
    @Ale..chenski, I've found a few ICs that indeed have seven downstream ports, e.g. the XR22417, but these cannot be used in bus powered mode at all, because that would violate the power budget. – Simon Richter Apr 5 at 20:44
  • 4
    There are very few (next to none) hubs on the market who follow any power budgets and passed USB-IF certification. – Ale..chenski Apr 5 at 20:48
4

I think gronostay is on the money with his "TL;DR: Don't do this" for fundamental reasons.

That said, I suppose you could simply supply your own 5V to the drives. Ignore the hub power, cut the cables (or better: connectors) to the drives open and connect the VCC and GND pins to a sufficient 5V power supply. You can even provide simple switches for switching them on separately in order to avoid an initial power surge.

There are a few details which others may be able to answer: Do you need a common ground with the hub? What quality must the 5V supply have (ripple, voltage precision)?

| improve this answer | |
2

It's been a while since I've worked with the USB spec, but USB-compliant devices go through device enumeration where they are basically asked by the host how much power they will need. Before enumeration is complete, they are allowed 100mA of current. The request for current is part of the negotiation process. The top-level USB Host manages the overall current draw on the bus and my understanding is it will deny a new device's requests for power when the budget won't allow it. When the budget is spent, even modest requests should get denied. Somebody else can confirm if I remember this correctly.

Best case situation (USB2.0) they can be allowed up to 500mA, depending on who else is on the bus. With USB3.0 that amount went up to 900mA.

| improve this answer | |
  • The information you presented is indeed the same as my understanding. I have some knowledge, but I also don't consider myself to be a true USB expert. – RockPaperLizard Apr 24 at 6:28
  • I don’t think this question is about devices asking nicely to get more current but rather just attempting to draw it. – Daniel B May 4 at 14:53
  • But this is USB. Devices are not just given the current their load tries to draw. In order to be conformant and wear the USB Logo you have to play nice and go through enumeration. This is how the hardware protects itself from unwitting users who try to draw too much current. – Rich von Lehe May 5 at 15:27
  • Yes, well, that’s all nice and good in theory. The reality is that many devices just do whatever they want. After all, implementing a low-power mode for enumeration is extra work! // Primarily, this isn’t even about USB. I can try to draw whatever from a power supply. It could switch off, the voltage could drop to unacceptable levels, it could also overheat and burn/explode. Current is not pushed, it is pulled. – Daniel B May 5 at 17:44
  • It's really not extra work when you're buying and using one of the many readily-available silicon choices for implementing the USB interface to your product. You have to add descriptor information for your device in your code for any kind of driver to be matched up with your device when connected to the bus. Without a vendor ID and product ID and USB device class information the host machine won't know what you are and won't load any kind of driver to talk to you. I understand current is pulled, but you also understand a source can limit current, right? – Rich von Lehe May 6 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.