I'm making a bash script that copies files from one USB drive to other multiple drives.
One oldschool machine running Xubuntu dedicated for the job detects 30 devices with no problem. It has USB 2.0 ports only.
While another modern machine running Linux Mint doesn't detect more than 16 of these drives at a time. It has USB 3.0 ports only. After I connect more than 16 drives, the new ones stop to show up in lsblk.
What could be the cause?
As fduff pointed out, I checked dmesg after connecting the 17th USB drive, this is what it shows:
[ 531.519845] usb 3-220.127.116.11: new high-speed USB device number 46 using xhci_hcd [ 531.974582] usb 3-18.104.22.168: New USB device found, idVendor=abcd, idProduct=1234 [ 531.974585] usb 3-22.214.171.124: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 531.974586] usb 3-126.96.36.199: Product: UDisk [ 531.974587] usb 3-188.8.131.52: Manufacturer: General [ 531.974588] usb 3-184.108.40.206: SerialNumber: Љ [ 531.975337] usb 3-220.127.116.11: Not enough host controller resources for new device state. [ 531.975340] usb 3-18.104.22.168: can't set config #1, error -12
This makes it look like a hardware limitation, but the number of allowed USB devices is not constant.
Now for example I can't connect more than 15 USB drives (the 16th gets error -12), before I was also able once to connect about 20 devices, and they got all discovered properly.
I tried using a different USB port to spread the usage across multiple USB controllers, but no luck.
My hardware specs:
MB: ASRock Z97 Extreme6 CPU: Intel Core i5-4690K GPU: MSI GeForce GTX 960 2GB RAM: HyperX Fury Black 8GB [2x4GB 1600MHz DDR3 CL10 DIMM] PSU: Chieftec GPS-500A8 [500W] Display: 2x AOC I2276VWM [IPS, 1920x1080] HDD: WD Blue 3TB
I'm also using a 28-port Manhattan USB hub: https://www.amazon.com/Manhattan-Port-USB-Hub-161718/dp/B0074024XU
A low-end dying PC running Xubuntu from LiveCD (on a USB drive) was able to detect 29 devices (30 counting the LiveCD drive) and perform file transfers - even though Windows XP that it had installed on HDD at some point failed to detect the 28-port hub at all. That PC now is being looked at by a repair service, because it died (I bet on PSU or MB). Still - it worked, and the shiny new one isn't.