How many external HDDs can you have in a Raspberry Pi 4 8gb?

I checked my lsusb -t, it seems my 7-ports hub is using 2 chips chained together as VL817 supports the maximum of 4-port configurations (like most, if not all USB controller chips) so port 4th is chained to another chip coresponding to port 4-7, it’s 3+4 configuration making 7 ports in total.

However, there is a caveat here. If you plug in the hub to any of the USB 3 port, a single hub will show itself as 2 devices (2 chips chained as explained above), but if you plug in the hub to any of the USB 2 port, a sigle hub will need to register itself as 4 devices first, then another 2 devices for the actual ports, as shown in my lsusb -t below:

/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 1: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 2: Dev 6, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 3: Dev 8, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 4: Dev 10, If 0, Class=Hub, Driver=hub/4p, 5000M
            |__ Port 3: Dev 15, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 1: Dev 12, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 4: Dev 17, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 2: Dev 13, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 3: Dev 9, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 4: Dev 11, If 0, Class=Hub, Driver=hub/4p, 5000M
            |__ Port 3: Dev 18, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 1: Dev 14, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 4: Dev 19, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 2: Dev 16, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 2: Dev 7, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 15, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 16, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 7, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 8, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 2: Dev 9, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 3: Dev 10, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 4: Dev 11, If 0, Class=Hub, Driver=hub/4p, 480M
                |__ Port 4: Dev 14, If 0, Class=Mass Storage, Driver=usb-storage, 480M
                |__ Port 3: Dev 13, If 0, Class=Mass Storage, Driver=usb-storage, 480M
                |__ Port 1: Dev 12, If 0, Class=Mass Storage, Driver=usb-storage, 480M
  • 5000M is USB 3, 480M is USB 2.

By knowing the above info and my Pi limitation, theotically I should get a maximum of 20 drives connection: (20+(2*2)+(1*6) = 30 connections.

  • After restarting my Pi, I don’t know why I can’t replicate 21 drives connection anymore. I can only do 20 drives 100% of the time while the 21st drive only show as HDD in GNOME Disk without any option to be mounted.

Therefore I think 20 drives connection is the practical limit for the Pi.

However, there’s still more interesting fact here. The xHCI host in Pi 4 actually support 34 devices maxed not 32, as my lsusb | wc -l returns 34. My dmesg | grep xHCI returns 4 devices as the xHCI Host Controller:

[    2.641083] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    2.642213] usb usb1: Product: xHCI Host Controller
[    2.643502] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    2.643780] usb usb2: Product: xHCI Host Controller

Nevertheless, it’s still endup 30 actual available slots for your device. And no matter hub you choose, as most of the chips (if not all) only support 4 downsteams/ports configuaration per chip, you will most likely limited with 20 usable USB ports :sweat_smile:

Such a long journey for me as a Pi farmer :sweat_smile:

3 Likes