B.Jay
Posts: 28
Joined: Thu Jul 18, 2013 10:57 pm

USB Hard Drive issue

Sat Sep 14, 2013 8:22 am

Hi!

I got a little problem here with a USB attached hard drive ...

Raspberry Pi in question is a Rev.B (512MB) board, latest Raspbian image (on a 32GB Transcend Class 10 SD), up-to-date Linux / Firmware / Bootloader (runs with the firmware/loader from Sep. 10th) powered through a 1.2A USB power adapter - and nothing is overclocked.

For now I connected a Seagate ST3500630AS (500GB, SATA) sitting in a Sharkoon SATA Quick Port XT (the "dock" has its own power supply and I tested it being stable using a dummy load and a bench multimeter) and is directly connected to the Raspberry. The only other USB device attached is a Logitech Unifying Receiver. The plan actually is to connect a USB Hub and attach two hard drives (same HDD / USB Dock).

The problem I have here is that while copying data to the hard drive, over the network from my desktop computer, the kernel bombs out with a "hung task" - see below:

Code: Select all

Sep 13 10:35:19 raspberrypi kernel: [69243.554745] INFO: task jbd2/sda1-8:445 blocked for more than 120 seconds.
Sep 13 10:35:19 raspberrypi kernel: [69243.554767] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Sep 13 10:35:19 raspberrypi kernel: [69243.554781] jbd2/sda1-8     D c03a0214     0   445      2 0x00000000
Sep 13 10:35:19 raspberrypi kernel: [69243.554874] [<c03a0214>] (__schedule+0x2b0/0x5a0) from [<c016878c>] (jbd2_journal_commit_transaction+0x1b8/0x18bc)
Sep 13 10:35:19 raspberrypi kernel: [69243.554912] [<c016878c>] (jbd2_journal_commit_transaction+0x1b8/0x18bc) from [<c016cf0c>] (kjournald2+0xbc/0x298)
Sep 13 10:35:19 raspberrypi kernel: [69243.554956] [<c016cf0c>] (kjournald2+0xbc/0x298) from [<c003aa0c>] (kthread+0x88/0x94)
Sep 13 10:35:19 raspberrypi kernel: [69243.555042] [<c003aa0c>] (kthread+0x88/0x94) from [<c000e9fc>] (kernel_thread_exit+0x0/0x8)
Sep 13 10:35:19 raspberrypi kernel: [69243.555113] INFO: task flush-8:0:2900 blocked for more than 120 seconds.
Sep 13 10:35:19 raspberrypi kernel: [69243.555124] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Sep 13 10:35:19 raspberrypi kernel: [69243.555133] flush-8:0       D c03a0214     0  2900      2 0x00000000
Sep 13 10:35:19 raspberrypi kernel: [69243.555181] [<c03a0214>] (__schedule+0x2b0/0x5a0) from [<c03a0aa0>] (io_schedule+0x88/0xe4)
Sep 13 10:35:19 raspberrypi kernel: [69243.555225] [<c03a0aa0>] (io_schedule+0x88/0xe4) from [<c008edc8>] (sleep_on_page+0x8/0x10)
Sep 13 10:35:19 raspberrypi kernel: [69243.555255] [<c008edc8>] (sleep_on_page+0x8/0x10) from [<c039f1e4>] (__wait_on_bit_lock+0x7c/0xa8)
Sep 13 10:35:19 raspberrypi kernel: [69243.555284] [<c039f1e4>] (__wait_on_bit_lock+0x7c/0xa8) from [<c008eda8>] (__lock_page+0x84/0x9c)
Sep 13 10:35:19 raspberrypi kernel: [69243.555314] [<c008eda8>] (__lock_page+0x84/0x9c) from [<c0137528>] (ext4_num_dirty_pages+0x1a8/0x1ac)
Sep 13 10:35:19 raspberrypi kernel: [69243.555344] [<c0137528>] (ext4_num_dirty_pages+0x1a8/0x1ac) from [<c013cb6c>] (ext4_da_writepages+0x3cc/0x43c)
Sep 13 10:35:19 raspberrypi kernel: [69243.555378] [<c013cb6c>] (ext4_da_writepages+0x3cc/0x43c) from [<c00987d0>] (do_writepages+0x24/0x38)
Sep 13 10:35:19 raspberrypi kernel: [69243.555412] [<c00987d0>] (do_writepages+0x24/0x38) from [<c00e8654>] (__writeback_single_inode.isra.23+0x28/0x11c)
Sep 13 10:35:19 raspberrypi kernel: [69243.555437] [<c00e8654>] (__writeback_single_inode.isra.23+0x28/0x11c) from [<c00e897c>] (writeback_sb_inodes+0x234/0x40c)
Sep 13 10:35:19 raspberrypi kernel: [69243.555464] [<c00e897c>] (writeback_sb_inodes+0x234/0x40c) from [<c00e8bc4>] (__writeback_inodes_wb+0x70/0xac)
Sep 13 10:35:19 raspberrypi kernel: [69243.555525] [<c00e8bc4>] (__writeback_inodes_wb+0x70/0xac) from [<c00e8ddc>] (wb_writeback+0x1dc/0x204)
Sep 13 10:35:19 raspberrypi kernel: [69243.555557] [<c00e8ddc>] (wb_writeback+0x1dc/0x204) from [<c00e9858>] (wb_do_writeback+0x1e8/0x1fc)
Sep 13 10:35:19 raspberrypi kernel: [69243.555583] [<c00e9858>] (wb_do_writeback+0x1e8/0x1fc) from [<c00e98e8>] (bdi_writeback_thread+0x7c/0x150)
Sep 13 10:35:19 raspberrypi kernel: [69243.555613] [<c00e98e8>] (bdi_writeback_thread+0x7c/0x150) from [<c003aa0c>] (kthread+0x88/0x94)
Sep 13 10:35:19 raspberrypi kernel: [69243.555645] [<c003aa0c>] (kthread+0x88/0x94) from [<c000e9fc>] (kernel_thread_exit+0x0/0x8)
This happens rather randomly ... can happen right after just a few Megabyte have been transferred, can happen after a few hundred Megabyte have been transferred. Doesn't matter by which means I copy the data (SSHFS, scp, Samba, NFS) and it doesn't matter which one of the two HDDs/Docks I use.

Once the copying stalls (desktop system just sits there and stalls till timeout, the hard drive on the Raspi just spins and keeps on flashing the "transfer" LED on the dock not doing anything) the Pi won't properly shut-down anymore ("sudo halt" hangs right after showing the "System is going down" message - only way out is to pull power).

I know the Sharkoon dock is a USB 3.0 device (believe it or not, but the dealerships around my place don't have USB 2.0 enclosures/docks anymore) - but they should be backwards compatible to USB 2.0 (at least it works flawlessly when I connect it to an USB 2.0 port on my desktop / laptop).

EDIT: I use "usbmount" to auto-mount the hard drive upon system boot, just to add this piece of information though I don't think it's the root of the problem. /EDIT

Now, the question is ... any chance the Raspberry has a problem with USB 3.0 devices on its USB 2.0 port, or could this be a kernel related problem, or would I need to issue some weird kernel parameter?

Any good ideas to try and resolve the problem are greatly appreciated.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: USB Hard Drive issue

Sat Sep 14, 2013 11:32 am

I'd suspect the USB, The Pi doesn't see eye to eye with many USB 2.0 & 1,1 devices let alone USB 3.0. For what I do with USB I can avoid hubs altogether (one less thing to go wrong) , but its not an option with a bus powered USB HDD.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

B.Jay
Posts: 28
Joined: Thu Jul 18, 2013 10:57 pm

Re: USB Hard Drive issue

Sat Sep 14, 2013 1:01 pm

Well, I did a bit of further testing...

I just ripped apart some old, long-forgotten, Icy Box USB enclosure I found in my dusty electronics box (enclosure has a nasty damage at the space where the hard drive is supposed to be mounted) containing a USB 2.0 <-> PATA/SATA bridge. Connected the Seagate drive to the bridge board and provided power from my bench power supply (can't find the original power adapter).

With this one it works perfectly, no matter if it's directly connected to the Pi's USB port or connected to the USB Hub (a cheapo Revoltech USB 2.0 Hub - comes with a 5V/3.5A power adapter and the hub has the annoying 5V feed-back issue; already rectified by taking it apart and slapping a diode into the 5V lead of the built-in USB chord so it doesn't feed power into the Pi through the USB "uplink" cable therefore bypassing the µUSB power connector/polyfuse).

Connecting the other hard drive (the one in the second Sharkoon dock) to the hub: well, copying data to "/media/usb1" leads to the same "task hung" kernel bomb - so it seems the Pi really has a problem getting cozy with USB 3.0 hardware on the USB 2.0 bus - bummer.

Just for the fun of it I tried the Sharkoon dock on another ARM board I've sitting around (since mentioning competitors seems to be a no go around here let's just say it's some "Black" board) and there it works just fine (directly connected to the USB 2.0 OTG port as well as through the hub) using Ubuntu ARM. Seems I can use the docks and drives in this project at least.

Conclusion: I think I'll stick with the bridge board out of the Icy Box enclosure since it at least cooperates nicely with the Pi.

Return to “Troubleshooting”