1

I have an hub for HDDs where I have two of them (WD purple 2TB).

If the Raspberry is ON and I switch on also the hub, the two HDDs are recognized by the Pi as sda and sdb (listed with sudo fdisk -l).

While if the Raspberry is switched off and the hub is switched on and I turn on the Raspberry, the two HDDs are not recognized (so not listed too).

In some discussions I read about adding to /boot/cmdline.txt rootdelay=5. I tried it but, nothing changed, so I tried also 10, 15, 150. But as before, it didn't solved the issue.

What could be?

1

You could try something akin to what worked here with regard to an OTG hub on a Pi Zero.

However, the situation is a little different on the other models, where the onboard hub has two entries in /sys (possibly due to the ethernet controller which is part of the USB controller, but more likely due to the way the hub is configured for use as a USB master -- doesn't matter for our purposes).

You need to go into /sys/bus/usb/devices, where there is set of symlinked directories and files; we are interested in the directories which have a format such as 1-1:1.0, keeping in mind that that and 1-0:1.0 are the onboard hub. There is a bit of an explanation of how to do that here, although that may not be easy to follow partially because of how the numbering scheme output from lsusb -t works. However, that command should clearly indicate the hub itself as a brand identifier should be included. Most likely, the directory you are looking for is 2-0:1.0.

Inside there is another set of symlinks, one of which is driver. Use readlink driver to see what that points to; if it ends in bus/usb/drivers/hub you've found it [but see also comments at bottom].

Now go to /sys/bus/usb/drivers/hub (you can use the driver symlink, e.g., cd driver); there will be symlinked directories there including 2-0:1.0 (if that's the hub). There should also be two file nodes, bind and unbind. As per the answer linked in the first question, from inside that directory, try:

echo "2-0:1.0" > unbind

Then

echo "2-0:1.0" > bind

You have to do this as root, e.g., by using su; you cannot use sudo because they use redirection (>), but you could put them in a script with a brief sleep, as per the first linked answer, and use sudo with that.

Beware when you do this everything on the hub will be disconnected, so if that includes a wifi adapter and you are logging in remotely, you will have to attach that directly to the pi first instead. It doesn't matter about the pi itself because the power from the hub won't be affected.

Now try just plain lsusb. It and fdisk -l should show the drives.

If that works, you can use the same strategy from the first linked answer with /etc/rc.local to ensure when the pi boots up, the drives should be found. That file is run root by the init system, but you can run it yourself to similar effect (in this case, anyway) with sudo.

  • 1
    Great, this is the solution. There's just something different, infact I saw from lsusb -t that the driver of my HDDs' hub, when connected after switched off and on again, is usb-storage so I unbinded and binded from /sys/bus/usb/drivers/usb-storage – Mitro Jul 25 '16 at 15:14
  • 1
    I've noted that for posterity ;) Plugging and unplugging the data link to the hub is probably an easy way to find the directory if you are looking in /sys/bus/usb/devices with a file browser too. – goldilocks Jul 25 '16 at 15:18

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.