Ubuntu Linux: Is your external usb drive slow?

I don’t know when this happened but my external USB drives were running really slow. Reading RAW images off them took ages, backups took forever, and moving files back and forth was plain slow.

I use two Seagate FreeAgent external drives. They’re both USB 2 devices so should sustain more than the maximum 1MB/s I was seeing. I decided to go looking. First stop was /var/log/syslog where I found the following:

usb 2-1.2.4.4: new full speed USB device using uhci_hcd and address 13
usb 2-1.2.4.4: not running at top speed; connect to a high speed hub

To cut a long story short, after a few searches I found bug 66115 where the same problem is described. Unfortunately the ticket has since been closed but the work around discovered by Jean Pierre Rupp works for me too. I haven’t modified any files in /etc/ but unloading ehci_hcd and uhci_hcd and reloading in the correct order worked for me:

rmmod ehci_hcd
rmmod uhci_hcd
modprobe ehci_hcd
modprobe uhci_hcd

Now I get a very respectable 15-20MB/s when using rsync to transfer files from my internal drive and reads are super fast:

hdparm -tT /dev/sdi1

/dev/sdi1:
Timing cached reads: 3964 MB in 2.00 seconds = 1985.16 MB/sec
Timing buffered disk reads: 82 MB in 3.03 seconds = 27.08 MB/sec

Next on the TODO list is making sure the modules are loaded in the correct order on reboot. Time to dive into /etc

14 thoughts on “Ubuntu Linux: Is your external usb drive slow?

  1. UHCI is USB 1.0 , do you have any USB 1.0 controllers/devices? If not you can probably blacklist it:) Make sure, because unfortunately UHCI can only do USB 1.0

  2. thanks i had the same problem, though i missed the line “[16897.589022] usb 2-6: new full speed USB device using ohci_hcd and address 26
    [16897.789061] usb 2-6: not running at top speed; connect to a high speed hub”

    i tried what you’ve suggested but it didn’t work, it’s still the same, maybe i should reset the pc, i’l try that later…
    just to tell you after i’ve done that i got this messages in dmesg :

    [23095.811243] Warning! ehci_hcd should always be loaded before uhci_hcd and ohci_hcd, not after ”
    don’t really know why is that there…

  3. Thanks!

    I had amazingly slow USB on Mint 9 / fluxbox (ubuntu 10.04 at base), and fixed it by doing all these things and rebooting:

    1 – Doing what you said here – but I got errors msgs, so maybe it didn’t do anything.
    2 – Using an mouse-plug (what’s the right name?) adapter for a USB mouse.
    3 – Adding “pci=routeirq” boot parameter to the 2.6.32-36-generic-pae (updated kernel) entry.

    USB speed went from about zero to:
    Timing cached reads: 1766 MB in 2.00 seconds = 882.36 MB/sec
    Timing buffered disk reads: 96 MB in 3.05 seconds = 31.43 MB/sec

    1. The above also fixed SD cards (formatted FAT16), which went from not really working at all to about 8MB/sec, about the same speed I get under Win7 (same machine).

  4. Thanks! I guess…

    I’m on Ubuntu Server 10.04LTS with the same symptoms.

    My problem seems fixed, but I can’t figure out what I did. I stored the history of my shell commands. Relevant ones are:
    > sudo rmmod usb_storage
    >sudo modprobe ehci_hcd
    >modprobe uhci_hcd
    >modprobe usb_storage

    Under 10.04, the module uhci_hcd doesn’t seem to be loaded by default, instead you get a module called usb_storage. So instead of reloading uhci_hcd, I reloaded usb_storage. That helped!

    But when I reboot, I expect to be back where I’m getting 1 MB/s throughput. I’m not though — I still get good speeds without having changed anything… Or have I?

  5. OK, I think I got it. I didn’t have the symptoms of my problem quite straight. It turns out that actually, when I rebooted (default kernel settings) I would always get good speeds (30 MB/s buffered disk reads), but after a while, performance suddenly goes to 1 MB/s buffered reads.

    When this happens, I see a message in /var/log/syslog:
    Dec 8 15:46:20 thuis kernel: [59406.314891] irq 5: nobody cared (try booting with the “irqpoll” option)
    (… stacktrace …)
    Dec 8 15:46:20 thuis kernel: [59406.315738] Disabling IRQ #5

    Indeed, booting with the irqpoll option changes things. If I do that, I consistently get 3 MB/s buffered disk reads, which is better than 1 MB/s but way below 30 MB/s that I should be seeing.

    I’ve tried kernel options “pci=irqroute,noacpi acpi=noirq” but this hasn’t helped. I’ll try irqfixup, acpi_irq_pci=5, and I’ll see if there’s something in the BIOS.

  6. I’m wondering if this is an old problem (looking at the blog post’s date) resurfacing (considering that this is a new problem for me, and at least Flemur and Paul both commenting in December).

    I’ve had this issue, I believe, for about a month now. I didn’t realize what the real problem was until just now. I use a 100 Mbps Ethernet USB dongle to connect to the internet, and I’ve noticed for the last couple of weeks that sometimes when I’d boot, the net would be darn slow – downloads maxing out at way below 1 MBps, where they should hover at more than 4.5 MBps. A reboot would usually fix it.

    I thought it was the (cheap) dongle’s fault, but now I’m looking at abysmal performance with my new Transcend 700 stick which *should* provide me with about 70 MBps reads (on USB 3.0, though). Instead, I get keyboard smashing slow reads and writes, with lots of timeouts and failed transfers.

    I found this post after searching for stuff about slow USB speeds with Ubuntu, and sure enough, my devices are either not recognized at all (a 2TB WD external) or recognized as full speed devices, no matter the USB port.

    I haven’t been successful with rmmodding and modprobing (yet), so I’ll look a bit further. But I could swear that this issue did not exist when I installed Oneiric, and that it’s new as of about two weeks back. If it isn’t a broken update, I’m wondering if there’s a USB device triggering this… Although there’s not really anything *new* that’s been attached recently. Except for my keyboard, actually… I had a small Apple attached before, but had problems with it not being recognized after a KVM switch if the mouse was connected via the Apple keyboard’s hub, so I switched back to my old HP keyboard… Hmmm…

  7. Okay, like Paul, my problem doesn’t show itself until after a while of system uptime. It doesn’t come with an irq5 error, though. The USB bus simply seems to be reset periodically for no apparent reason. E.g. some first messages that trigger a range of USB devices begin reset, too:

    Jan 4 00:54:21 lnxsrv kernel: [27221.532092] usb 2-6: reset high speed USB device number 16 using ehci_hcd

    – and –

    Jan 4 00:56:27 lnxsrv kernel: [27347.532544] generic-usb 0003:046D:C01E.000D: can’t reset device, 0000:00:1d.7-2.1/input0, status -32

    – and –

    Jan 4 01:22:15 lnxsrv kernel: [28895.561301] generic-usb 0003:046D:C01E.0014: can’t reset device, 0000:00:1d.7-2.1/input0, status -71

    There are, however some hints (“maybe the USB cable is bad?”), so I’ll look into that. Anyway, this isn’t a bug report system, so I’ll take it elsewhere 😉 Cheerio!

      1. I’m fairly certain there isn’t – it’s a brand new USB stick. The bus that keeps getting reset, though, is the one on my KVM, where I’ve attached a simple USB 1.1 4-way hub (the passive kind that’s just like an octopus cable). I’m suspecting that the messages about bad cables might be right, and might be this cable. It coincides with the fact that the issue is about as new as when I switched from my mini Apple keyboard with built-in USB hub to this hub cable+keyboard+mouse combo.

        The KVM actually also sports a PS/2 port, and I’ve made a trip to the attic and dusted off some old (squeaky) PS/2 keyboards, gotten rid of the USB hub, and now I’ll just have to wait and see if the issue reappears 🙂

        Cheerio, and happy New Year! 🙂

  8. It’s been a while since I had any issues since switching to PS/2 without a USB hub. I *did* have one time where the issue arose once more, and I *think* it happened when using the KVM to switch to my other puter and back.

    This didn’t happen in “the good ‘ole days”, so I do believe it might be due to a bad handling of USB fault states in newer kernels, but for now I’m not gonna act more upon it.

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close