User avatar
alexandru.cucu
Posts: 75
Joined: Mon Sep 05, 2011 6:07 pm
Contact: Website

I/O error when reading flash drive

Sat Jun 02, 2012 11:45 am

From dmesg:

Code: Select all

usb 1-1.2: new high speed USB device number 4 using dwc_otg
usb 1-1.2: New USB device found, idVendor=0930, idProduct=6545
usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.2: Product: DataTraveler 2.0
usb 1-1.2: Manufacturer: Kingston
usb 1-1.2: SerialNumber: 000AEBFFB4C1B8B1931D037B
scsi0 : usb-storage 1-1.2:1.0
usbcore: registered new interface driver uas
scsi 0:0:0:0: Direct-Access     Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
sd 0:0:0:0: [sda] 15687680 512-byte logical blocks: (8.03 GB/7.48 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
DEBUG:handle_hc_chhltd_intr_dma:: XactErr with NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

usb 1-1.2: USB disconnect, device number 4
sd 0:0:0:0: [sda] Unhandled error code
sd 0:0:0:0: [sda]  Result: hostbyte=0x01 driverbyte=0x00
sd 0:0:0:0: [sda] CDB: cdb[0]=0x2a: 2a 00 00 00 00 20 00 00 08 00
end_request: I/O error, dev sda, sector 32
Buffer I/O error on device sda1, logical block 0
lost page write due to I/O error on sda1
EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
usb 1-1.2: new high speed USB device number 5 using dwc_otg
usb 1-1.2: New USB device found, idVendor=0930, idProduct=6545
usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.2: Product: DataTraveler 2.0
usb 1-1.2: Manufacturer: Kingston
usb 1-1.2: SerialNumber: 000AEBFFB4C1B8B1931D037B
scsi1 : usb-storage 1-1.2:1.0
scsi 1:0:0:0: Direct-Access     Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
sd 1:0:0:0: [sdb] 15687680 512-byte logical blocks: (8.03 GB/7.48 GiB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 23 00 00 00
sd 1:0:0:0: [sdb] No Caching mode page present
sd 1:0:0:0: [sdb] Assuming drive cache: write through
sd 1:0:0:0: [sdb] No Caching mode page present
sd 1:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
sd 1:0:0:0: [sdb] No Caching mode page present
sd 1:0:0:0: [sdb] Assuming drive cache: write through
sd 1:0:0:0: [sdb] Attached SCSI removable disk
After mounting, when I try to list the content of the drive:

Code: Select all

ls: reading directory .: Input/output error
The flash drive is working just fine on my other machines.

Any ideas on what might cause this problem?
https://launchpad.net/~alexandru.cucu

User avatar
soslug
Posts: 40
Joined: Mon May 21, 2012 12:31 pm
Location: Southend on Sea
Contact: Website Yahoo Messenger

Re: I/O error when reading flash drive

Sat Jun 02, 2012 11:52 am

Try to list the contents with this

sudo fdisk -l

enter password

This lists all attached storage devices and tables the formats of each drive and partition.
IPFreely, to weed the network demons that dwell in them their Windows!

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: I/O error when reading flash drive

Sat Jun 02, 2012 12:04 pm

@alexandru.cucu
What format is the disk?

I think I got an error like that with an NTFS formatted disk. I reformatted to ext4 and it was fine.

It is possible to get NTFS (and other filesystems) working through FUSE, but I'm not sure if that is set up by default.

User avatar
alexandru.cucu
Posts: 75
Joined: Mon Sep 05, 2011 6:07 pm
Contact: Website

Re: I/O error when reading flash drive

Sat Jun 02, 2012 12:10 pm

It mounts the drive with no error so it detects the right partition type.

Code: Select all

$ sudo fdisk -l /dev/sda

Disk /dev/sda: 8032 MB, 8032092160 bytes
4 heads, 32 sectors/track, 122560 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x020e4984

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      122560     7843824   83  Linux
I've been using GNU/Linux as my main OS for the past 5 years so it is not necessary to explain basic steps.

I have tried with ext3 and ext4 partitions, even created them from the RPi.
The partition is fine, I can write to it from my Ubuntu machine.
https://launchpad.net/~alexandru.cucu

User avatar
soslug
Posts: 40
Joined: Mon May 21, 2012 12:31 pm
Location: Southend on Sea
Contact: Website Yahoo Messenger

Re: I/O error when reading flash drive

Sat Jun 02, 2012 12:31 pm

If this is the only drive and partition all of it has been formatted as a ext3 which as I understand the Raspberry Pi using the SD Card cannot boot from you need a windows 95 partition whith which to boot before using linux.

You need to obtain the debian image from forum downloads then use dd or win32diskimager.exe (something like that)

then for dd use the following command

dd if=path/debian6-19-04-2012.img of=/dev/sd? bs=1M

dd = command used in linux (Debian or Ubuntu and most other linux and Mac)
if= = Input file also and the path to the file
debian6-19-04-2012.img = the image extracted from the zip file
of= = Output file or device (where /dev/sdd would be the fourth drive)
bs= Boot Sector set this to 1M

Obviously replace ? with the drive and do not try to build the image on the Raspberry Pi only boot from it.

I think i have it correct let me know if any of it is wrong.

Should be even simpler with win32diskimager.exe
IPFreely, to weed the network demons that dwell in them their Windows!

User avatar
grumpyoldgit
Posts: 1454
Joined: Thu Jan 05, 2012 12:20 pm

Re: I/O error when reading flash drive

Sat Jun 02, 2012 12:33 pm

The OP didn't say he was trying to boot from the flash drive, just mount it.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: I/O error when reading flash drive

Sat Jun 02, 2012 12:52 pm

It looks like Kingston Datatraveler 2.0 requires more that 100mA, so you may be seeing a power issue:

http://www.kingston.com/us/support/tech ... el=KUSBHS2
"5. If you have a desktop computer, make sure the DataTraveler is inserted directly into one of the main USB ports on the back of the PC. Front ports, keyboard ports or USB Hubs may not supply sufficient power for the High Speed DataTraveler to function properly. "

I think you will need an external powered hub to use this.

User avatar
alexandru.cucu
Posts: 75
Joined: Mon Sep 05, 2011 6:07 pm
Contact: Website

Re: I/O error when reading flash drive

Sat Jun 02, 2012 1:25 pm

It actually is a DTI/8GB

http://www.amazon.com/Kingston-DataTrav ... B0012X5766

And if I can format it on the Raspberry Pi I guess it gets the electricity needed to work.

[edit]
Just measured voltage between the two test points on the board and it is 4.80V with the USB drive connected and 4.92V without.
https://launchpad.net/~alexandru.cucu

wartstew
Posts: 14
Joined: Mon Jun 04, 2012 11:05 pm

Re: I/O error when reading flash drive

Sun Jun 24, 2012 1:41 am

I too am getting these errors, only in my case it gets much worse: I think I've destroyed two flash cards! :cry:

What happens is that about half way through copying an image using "dd" I start getting errors in in dmesg such as "Mode Sense: 03 00 00 00" and "reset high-speed USB device ...", finally just a bunch of "Buffer I/O error on device sdc, logical block 3337" and counting up each each block as it fails. Killing the dd task does nothing (even with -9 flag) but pulling it out of my machine stops it. Then when I reinsert it I find I can read from it but not write. I does say it is NOT write protected, but spits out lots of "Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE" "Sense Key: Illegal Request" and "lost page write do to I/O error" messages when I try to write to it. As long as I don't try to write to it, I can read from it however: Although in both cases the device had very corrupted file systems on it, they will pass a Linux "badblocks" read test with no errors, but not a write test. I can read lots if directories from the devices file system, but some file/directories will cause the device to hang. Perhaps it is trying to read illegal addresses?

In both cases I used a USB to SD card reader, one time was in the Raspberry Pi itself, the other time on an X86 Linux machine. In both cases the error occurred after the card was successfully used in the Raspberry Pi once, as in the first time I did the "dd" command everything worked, only after usage in the Raspberry Pi, then an attempt to write over the card did the problem occur. In both cases I used older 2GB microSD cards, not SDHC cards. I have successfully overwritten an 8-Gig Class 10 SDHC card at least once after being in the RP without problems (and using the same SD card reader). I don't know if I have just been lucky or if there might be a clue here.

The SD card consortium seems to to think you shouldn't write non FAT-32 file systems to an SD card, and even then you should only use their formatter to do it for wear leveling reasons. Is it a very stupid wear leveler program in the SD card that is causing this problem on these older cards? I've written other file systems to these cards before (typically iso9660 CDROM images) without problems.

Oh and in both cases the corruption/destruction has occured trying to install the Raspbmc xbmc specific distribution onto these cards.

runeks
Posts: 20
Joined: Mon Jul 23, 2012 11:34 am

Re: I/O error when reading flash drive

Wed Aug 01, 2012 2:23 pm

I'm experiencing this problem as well, with a 1 TB Western Digital WD10EZRX hard drive plugged into a Sandberg USB 3.0 to SATA docking station and connected to the Pi. These are the errors I get:

Code: Select all

[   15.488605] scsi 0:0:0:0: Direct-Access     WDC WD10 EZRX-00A8LB0     01.0 PQ: 0 ANSI: 5
[   15.517599] sd 0:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)
[   15.559877] sd 0:0:0:0: [sda] Write Protect is off
[   15.567034] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[   15.579604] sd 0:0:0:0: [sda] No Caching mode page present
[   15.606018] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   15.629440] sd 0:0:0:0: [sda] No Caching mode page present
[   15.643382] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   15.692029]  sda: sda1
[   15.715203] sd 0:0:0:0: [sda] No Caching mode page present
[   15.732149] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   15.761775] sd 0:0:0:0: [sda] Attached SCSI disk
[   20.158321] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[   31.367783] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SS
[  136.419523] device-mapper: ioctl: 4.21.0-ioctl (2011-07-06) initialised: dm-devel@redhat.com
[  209.374629] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[  934.116054] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[ 3796.634289] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null)
[  687.832363] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 1075.882627] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 1197.887194] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 1368.810465] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 1442.852435] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 1587.896404] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 1623.827379] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 1655.818359] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 1895.844844] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 2051.829113] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 2301.875839] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 2357.917362] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 2454.849983] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 2542.882334] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 2543.427243] sd 0:0:0:0: [sda] Unhandled error code
[ 2543.427278] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 2543.427306] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 46 ba c1 e0 00 00 f0 00
[ 2543.427383] end_request: I/O error, dev sda, sector 1186644448
[ 2737.867709] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 2805.869636] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 2877.871579] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 3234.901339] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 3352.904520] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 3421.886452] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 3488.878241] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 3802.590440] sd 0:0:0:0: [sda] Unhandled error code
[ 3802.590475] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3802.590504] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 47 5d ef e0 00 00 f0 00
[ 3802.590581] end_request: I/O error, dev sda, sector 1197338592
[ 3802.945812] sd 0:0:0:0: [sda] Unhandled error code
[ 3802.945848] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3802.945876] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 47 5d ef e0 00 00 08 00
[ 3802.945954] end_request: I/O error, dev sda, sector 1197338592
[ 3803.456938] sd 0:0:0:0: [sda] Unhandled error code
[ 3803.456972] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3803.457000] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 47 7c 28 00 00 00 20 00
[ 3803.457077] end_request: I/O error, dev sda, sector 1199319040
[ 3803.790185] sd 0:0:0:0: [sda] Unhandled error code
[ 3803.790219] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3803.790247] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 47 7c 28 00 00 00 08 00
[ 3803.790324] end_request: I/O error, dev sda, sector 1199319040
[ 3805.245943] sd 0:0:0:0: [sda] Unhandled error code
[ 3805.245978] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3805.246007] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 4c d4 d8 98 00 00 28 00
[ 3805.246084] end_request: I/O error, dev sda, sector 1289017496
[ 3805.601449] sd 0:0:0:0: [sda] Unhandled error code
[ 3805.601484] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3805.601512] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 4c d4 d8 98 00 00 08 00
[ 3805.601589] end_request: I/O error, dev sda, sector 1289017496
[ 3806.123694] sd 0:0:0:0: [sda] Unhandled error code
[ 3806.123730] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3806.123757] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 53 35 18 00 00 00 40 00
[ 3806.123832] end_request: I/O error, dev sda, sector 1395988480
[ 3806.423695] sd 0:0:0:0: [sda] Unhandled error code
[ 3806.423730] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3806.423758] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 53 35 18 00 00 00 08 00
[ 3806.423835] end_request: I/O error, dev sda, sector 1395988480
[ 3806.457076] sd 0:0:0:0: [sda] Unhandled error code
[ 3806.457111] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3806.457139] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 4f 80 19 00 00 00 28 00
[ 3806.457217] end_request: I/O error, dev sda, sector 1333795072
[ 3806.779324] sd 0:0:0:0: [sda] Unhandled error code
[ 3806.779359] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3806.779386] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 4f 80 19 08 00 00 20 00
[ 3806.779465] end_request: I/O error, dev sda, sector 1333795080
[ 3806.790322] sd 0:0:0:0: [sda] Unhandled error code
[ 3806.790356] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3806.790384] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 4f 80 19 30 00 00 18 00
[ 3806.790460] end_request: I/O error, dev sda, sector 1333795120
[ 3806.854272] EXT4-fs error (device dm-0): __ext4_get_inode_loc:3308: inode #41680971: block 166723620: comm deluged: unable to read itable block
[ 3806.875714] EXT4-fs error (device dm-0) in ext4_reserve_inode_write:4126: IO failure
[ 3807.379315] sd 0:0:0:0: [sda] Unhandled error code
[ 3807.379349] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3807.379377] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 45 eb 18 00 00 00 40 00
[ 3807.379455] end_request: I/O error, dev sda, sector 1173035008
[ 3807.690455] sd 0:0:0:0: [sda] Unhandled error code
[ 3807.690490] sd 0:0:0:0: [sda]  Result: hostbyte=0x07 driverbyte=0x00
[ 3807.690520] sd 0:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 45 eb 18 00 00 00 08 00
[ 3807.690597] end_request: I/O error, dev sda, sector 1173035008
[ 3993.922148] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 4109.965451] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[ 4140.926273] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[   53.964756] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[   88.935719] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[  391.974113] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[  425.945076] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[  537.018104] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[  602.949903] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
[  773.984712] usb 1-1.3: reset high speed USB device number 4 using dwc_otg
So there are both "usb 1-1.3: reset high speed USB device number 4 using dwc_otg" errors and "sd 0:0:0:0: [sda] Unhandled error code" errors. Might the two be related? They seem to happen at different points in time.

The SATA-to-USB controller is USB 3.0, but I assumed it is backwards compatible, is it not? It's not powered over USB.

User avatar
VascoFerraz
Posts: 76
Joined: Thu Aug 30, 2012 11:54 am

Re: I/O error when reading flash drive

Wed Dec 28, 2016 12:00 am

As already said, these problems are related to insufficient power...
Vasco Ferraz

Return to “Debian”

Who is online

Users browsing this forum: No registered users and 2 guests