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

Backups save the day

Marina City, Chicago A few weeks ago I blogged about my backup system. How I have two 1TB Iomega external drives and how one drive is a duplicate of everything on the other drive, and how I backup everything on my laptop and VPS accounts. It sometimes seem excessive but I’m paranoid.

This morning I’m very glad I went to such lengths. I wanted to copy some stuff onto my Macbook, and there’s nothing like the bandwidth available from a directly connected disk. I unmounted my drive, at least I tried. Something was keeping it mounted. Instead of following my own advice and checking what program was keeping the drive busy, I used “umount -l” instead. Turns out it was Rhythmbox, but I didn’t realise that until later.

Anyway, I disconnected the usb cable, plugged in the one connected to the Macbook (BTW – Ext2 for Mac OS X is useful for reading ext2/ext3 filesystems) and kaboom. The light on the external drive went out. Oh oh.

Long story short, the drive refused to mount again on the Linux box for several minutes. Eventually it did, but with errors. I’m running fsck.ext3 on it but it’s giving me tons of errors and won’t run automatically. I need to buy another drive this morning.

So what’s lost? My 8 years of photos? All the family videos shot over the last 2 years? My mp3 collection? Nope. They’re all backed up. Murphy’s Law states that if something can go wrong, it will. This was the worst time ever for a drive to fail as I had just reinstalled the operating system, and my backup system wasn’t running properly yet. Thankfully nothing irreplaceable was moved onto the broken drive in that narrow window of time when things weren’t being backed up.

I now want to get that new drive installed before the second goes belly up! Paranoid? You betcha!