What would happen when USB devices draw more power than the hub can provide?
Solution 1:
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.
Solution 2:
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.