-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
external USB drive: blk_update_request: I/O error and the USB drive gets another /dev/sd node #777
Comments
DMESG OUTPUT:
|
LSUSB OUTPUT:
|
Is there a firmware revision where this behaviour first started? I.e. can you identify which revision of firmware is the first bad one? |
Unfortunately no. I have my raspberry only since a few days. Before buying the powered USB hub, it gave the same problem (back then it was using a raspbmc distribution with kernel 3.12 but the errors in dmesg were similar/identical). Moreover, after /dev/sd node recreation I could also hear the typical noise of the external hard drive having problems starting up... for this reason I thought the problems were due to insufficient power and thus I bought the USB hub. Now the problem in dmesg is similar/identical but it doesn't really seem a power issue: the hard disk stay on even when attached just to the USB hub and additionally, after the /dev/sd node recreation the hard disk emits no noise... An additional thing: both the hard disk work just fine under Windows (and also under Linux on my workstation) even under heavy load... I think it must be something with dwc_otg driver... |
Another note: I also tried to power everything from the USB hub (15W should be enough for the 2 external HDD and the raspberry) using a micro USB cable that goes from the hub to the raspberry micro-USB connection. The same problem happens. Moreover, it also happens apparently randomly even when writing small files on the disk periodically (I have a script that writes 512B every 30 seconds)... for example just now I see:
that is, in idle conditions, after from second 38 to second 19013 no problem, then suddenly the USB failure. |
Tried with another hard disk (again, over USB). I left it idle (mounted on the filesystem but without read/writes from userspace) for ~3days: no problem.
By the way I'm a C/C++ developer... if you could point me to the right point of the code writing those "sd 0:0:0:0: [sda]\nResult: hostbyte=0x07 driverbyte=0x00" I could help you with understanding the failure reason perhaps (althought I don't know much about USB driver routines!)... |
Actually I found that this bug is possibly related to the following long-standing issue in Linux kernel: |
I have a similar issue Running crashplan on a raspberry pi Raspberry PI B with own powersupply - booting from SDCard USB drive disconnecting as device 4 and reconnecting as 5 Details:
Did an RpI-update to get lastest firmware
I'm not a linux guru, but trying my best to understand things , and solve where possible. |
I confirm that this happens with Raspbery Pi 2 B running: I have a RAID attached via USB 3.0 (limited to 2.0 by RPi hardware) And it seems to happen under heavy traffic load. Is a 2x2TB in RAID 0 (total of 4TB drive). It fails when checking torrent downloads. |
In my case it was 100% power related. I was able to test the drive and generate different load conditions with the command 'badblocks' and tuning of the parameters -d -c- b ( fe: sudo badblocks -e 100 -v /dev/sda1 -s -c 32 -d 50). As a result the drive failed on different blocks or not at all. This was an indication that the individual blocks were ok. Changing the powersupply of the RPI (2A) did not help neither. After buying a USB3 Y-cable to power the drive from another USB port, all got solved and my drive is still running fine for weeks now. http://www.ebay.com/sch/i.html?_from=R40&_nkw=usb3+y-cable Hope this helps your case too. |
In my case, the USB RAID is self-powered, so the power should not be any problem. |
Worth to try some badblocks tests to see if you can reproduce a failure? "sudo badblocks -e 100 -v /dev/sda1 -s" will test at maximum speed. If failure should occur each time in different blocks it would put the hard drive out of the scope. |
After checking it with badblocks, after about 6 hours of checking it stopped after this error message:
The last two were me trying to do a |
By the way I still haven't solved this problem. Just FYI: I see the same problem on both Raspberry PI model B+ and on my BeagleBone. The hard disks triggering this problem are miscellaneous:
It may help if you write down the manufacturers and model names of the hard disks that trigger this problem (the "Result: hostbyte=* driverbyte=*" error message). Thanks! |
Another comment: on my desktop computer running Ubuntu Trusty 14.04 no problem are reported when transferring large files between the disks reported above. |
I'm not sure if it is related, however I'll share anyway, since it can help someone. When I was assembling my rpi file server, with two external hard drives plugged into an usb hub, both in those cheap enclosures, I was not be able to use them till I've used a power source of 5.3 V (to the usb hub), instead 5.0 V. So, I strongly recommend trying a higher voltage power source. |
I have the same error using a WD 2TB USB3 disk, refer https://www.google.de/url?url=https://github.com/raspberrypi/linux/issues/885&rct=j&q=&esrc=s&sa=U&ei=qz82VZIhwaewAYDNgKAN&ved=0CBoQFjAB&sig2=OFhTaepwrroA5QRZuaWnUQ&usg=AFQjCNEzwcQ-hGcApolnu3RnIxP6Et4JdA HDD: DetailsHDD D I actually have two Pi's, each with same model USB HDD. 1st on is a Model B, 2nd one a Model 2B. Works fine on the older Model B, but the problem occurs on the newer Model 2 B. Kernel and Firmware on older Model B Kernel and Firmware on newer Model 2 B sudo /opt/vc/bin/vcgencmd version |
The result of the test should perhaps show it the issue remains related to HD, RPI/OS version or power supply . |
I don't think it's a power related error, since it worked perfectly in Raspberry Pi B, but it's not working in Raspberry Pi 2 B. In any case, I might be able to try it again in Raspberry Pi B this weekend. |
Yes, I can try it out using Pi B and Pi 2B and the two drives. I cannot try external power y-cable - don't have one and also, since it has the drive has been working flawelessly on Pi B using internal power for well over a year, I think it is reasonable to expect it to work on Pi 2B. |
Pi2 can use more power that Pi1, so I don't think you can infer a power supply that is good for Pi1 is necessarily good for Pi2. |
But in my case, the HDD RAID is self powered.
|
FYI, Adafruit have released a tutorial on adding an external HDD to a Pi, and they say:
|
In my case, I'm using a powered USB hub (certified for USB 3.0, so that the Perhaps to be sure the only way would be attaching an oscope to the USB Honestly, I suspect some driver issue, either on Linux driver side or in Just my 2cents, 2015-04-24 14:17 GMT+02:00 Phil Elwell notifications@github.com:
|
Hi all, I'm having this very same problem but not on a raspberry, just a regular intel computer. My HDD is attached to a SATA-to-USB adaptor and it shows this exact same behaviour. It actually started after an update to the system, including a Kernel update, so the problem must be there, since no hardware was changed, and I even tested two different linux distros (opensuse 13.2 & ubuntu 15.04) both does exaclty the same. Today I will try a regression to an older linux distro an see if the problem "solves" just to be sure of this. Regards! |
I can confirm (almost 100% sure) that it is not power related. I have bought a 5V 2A PSU for the Raspberry Pi 2 and a powered USB hub to connect the storage there. As I said before the storage is self powered, so there is no doubt that all has enough power. But it continues to fail. This time after more than 2 hours of use, but it disconects the device and adds it as a new drive (even if UUID is the same). In my change to the USB hub I also ran into #824. In any case I could do a workaround for that (changing the root delay, as said in the issue comments). The thing is that as we have seen, under heavy load, the device simply disapears from /dev. Here is, again the dmesg:
|
I think cause is heat. |
Neither of those devices requires a heatsink. |
same question. model 2 B with USB 3.0 HUB. The problem is the USB3.0. 2.0 works well. |
Also seeing this issue with a rpi model 2B & USB 3 self-powered hub, and 4GB USB seagate drive. |
I uses 2 external disks and only one disk has the same problem.
|
Having the same issue on a virused USB Flash Kingston DT101 G2 (16GiB). I think the virus affected its boot sectors and now the Kernel is unable to read the size of the device in order to mount it properly.
Bus 001 Device 012: ID 0951:1665 Kingston Technology Digital DataTraveler SE9 64GB
# connect the usb
[Sun Apr 2 14:51:35 2017] usb 1-1.2: new high-speed USB device number 12 using ehci-pci
[Sun Apr 2 14:51:35 2017] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[Sun Apr 2 14:51:35 2017] scsi host6: usb-storage 1-1.2:1.0
[Sun Apr 2 14:51:37 2017] scsi 6:0:0:0: Direct-Access GENERIC USB Mass Storage 1.00 PQ: 0 ANSI: 4 CCS
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: Attached scsi generic sg2 type 0
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] Read Capacity(10) failed: Result: hostbyte=0x00 driverbyte=0x08
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] Sense Key : 0x6 [current]
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] ASC=0x28 ASCQ=0x0
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] 0 512-byte logical blocks: (0 B/0 B)
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] 0-byte physical blocks
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] Write Protect is off
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] Mode Sense: 45 00 00 00
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] Read Capacity(10) failed: Result: hostbyte=0x00 driverbyte=0x08
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] Sense Key : 0x6 [current]
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] ASC=0x28 ASCQ=0x0
[Sun Apr 2 14:51:37 2017] sd 6:0:0:0: [sdb] Attached SCSI removable disk
# disconnect the usb
[Sun Apr 2 14:51:44 2017] usb 1-1.2: USB disconnect, device number 12 Since it didn't read the size, he didn't even attach the filesystem
output of NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 232.9G 0 disk
└─sda1 8:1 0 232.9G 0 part
├─root--vg-boot 254:0 0 3.1G 0 lvm /boot
├─root--vg-root 254:1 0 50G 0 lvm /
├─root--vg-swap 254:2 0 500M 0 lvm [SWAP]
└─root--vg-home 254:3 0 150G 0 lvm /home
sr0 11:0 1 1024M 0 rom CONCLUSION boot sectors affected, USB Flash is bricked. 🗑️ ♻️ |
Hi from the OpenWRT community! ✋ When it happens very similar error-messages as above shows, and the sd-card disconnects from the device, and then re-appears a second later with a new identifier each time (/dev/sda -> /dev/sdb - /dev/sdc) I know this thread is about Raspberry Pi, not OpenWRT. But i had to ask if you guys found a solution, because i'm pretty desperate to get this fixed. 😃 |
For everyone experiencing random device disconnects, what happens if you put a USB hub between the Pi and the device in question? |
Same problem here with Details about the usb hub, maybe to identify the chipset. Also have a look at the max power of 100mA, the drives have a max power up to 500mA. Maybe this would explain, why some hubs works (especially some chipsets) and others not, and why sometimes it seems, that a better power supply would do the trick also.:
two usb drives on hub, both WD MyPassport, 4TB,
Getting trouble when i rsync all data (nearly 4TB) from the "NTFS" drive to the "ext4" drive, dmsg output:
u see now sdc1 because the target drive, with ext4 get auto remounted as read only. a manually remount did the trick for a few hours copying data... all my drive in detail:
|
@P33M Is this covered by other USB issues? Can it be closed? |
hi, I explain about my case. 1st:"environment" Test case is copy 50GB(1000 files) to SSD from PC. 2nd:"environment" Test case is copy 50GB(1000 files) to SSD from PC. Different point is raspberry pi only. other all environment same as 1st. |
@P33M @M-Tomohiro Any further progress on this one? |
@JamesH65 Yes, there is no progress. |
Same issue for me, and solved. Hope it helps some of you. Sry for my poor english. |
This issue will be closed within 30 days unless further interactions are posted. If you wish this issue to remain open, please add a comment. A closed issue may be reopened if requested. |
I would like this issue to remain open, as i've yet to find a fix for it anywhere. And that would be really awesome to get. :) |
@adde88 I presume that you are using an up to date Raspbian, and that everything is sufficiently well powered? |
No, i'm not. That's why i'm ok with you closing it. But again, i respect your decision to close this, considering my issue is not directly related to the Raspberry Pi. |
OK, since this is no longer an RPi issue (as far as I can tell), I'll close it. |
Note that closed issues can still be searched and commented on. |
FWIW I have just "discovered" the same problem. I am running latest Raspbian Stretch
It seems the
What I find interesting is In my case I am running two additional USB devices on my RPi 3B: Below is the
|
Could it be the USB-SATA adapter that's buggy? I've had severe issues with a Revoltec enclosure, several dead sectors when using it. Can't read the bloody chip, but I think it's a Revoltec RS076 enclosure. |
It could, but when I tried it in normal PC (Windows 7), there was no problem (but I probably did not have other devices on the same USB hub either). |
I've done ALOT of debugging on my OpenWRT device. (Pineapple NANO) In ALL of the error messages it failed while using the SCSI OPCODE: 0x28 (READ) Here's some info about the device from lsusb:
I'll provide more feedback if i find anything of interest. |
This error may be related to this problem (I don't know how to solve it yet): https://en.opensuse.org/SDB:USB_3.0_Hard_Drive_troubleshooting |
qbitorrent would get cascading I/O errors (Input/Output Error), almost always with 50+ GB downloads. In addition, qbittorrent kept eating all my ram. Changing "File Pool Size" in the advanced options to something like 500 (instead of 5000), might be worth a try (or lower) if you're still having issues. |
Hi,
I found a quite-reproducible problem (happens quite often!) with the following setup:
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Linux rasptorrent 3.18.5+ Add ifdef to make kernel compile without CONFIG_BCM2708_DT=y #744 PREEMPT Fri Jan 30 18:19:07 GMT 2015 armv6l GNU/Linux
(did "rpi-update" on Jan 31 2015)
HOW TO REPRODUCE: just producing traffic on the USB external drives at some point produces:
(several times, for different sectors)
and the USB device (e.g., /dev/sdb1) is destroyed and a new dev node is created (e.g., /dev/sdc1).
The dwc_otg driver seems latest one:
and it seems that "FIQ enabled", "NAK holdoff enabled" " FIQ split-transaction FSM enabled" features are there.
I'm going to attach the dmsg and lsusb outputs. Please let me know if I can try some fix.
The text was updated successfully, but these errors were encountered: