public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* usb-storage: how to ruin your hardware(?)
@ 2003-08-21  1:34 H.Rosmanith (Kernel Mailing List)
  2003-08-21  1:55 ` Matthew Dharm
  2003-08-21  7:11 ` Alan Cox
  0 siblings, 2 replies; 23+ messages in thread
From: H.Rosmanith (Kernel Mailing List) @ 2003-08-21  1:34 UTC (permalink / raw)
  To: linux-kernel


hi,

just today, I bought an "USB BAR", a 128MB flash disk. I managed to make
the device unusable and only get scsi-errors from it.

what I did:
the flask disk came with a strange partition table, and fdisk told about
partition not ending on boundaries. so I just deleted the partitions and
put a new one it, spanning the whole flask disk. then I mke2fs /dev/sda1
it, which seemed fine. as next step I wanted to install lilo on the
flask disk, because some boards can boot from USB and I wanted a
bootable linux on the "USB BAR".

now lilo complained about that it would write into the partition table?
why that?! quite strange!

this puzzled me - after all, the device should behave like
a standard scsi-device. so I just played around with /dev/sda, copying
the first 512 byte from /dev/hda to it and installed lilo then. then I
deleted everything again, copied /dev/zero (512 byte) to /dev/sda,
repartitioned, re-mke2fsd etc. etc...

and now all I ever see from the device are scsi-errors, like these:

    : Raw sense data:0x70 0x00 0x03 0x00 0x00 0x00 0x00 0x0a 0x00 0x00
    :                0x00 0x00 0x11 0x00 0x00 0x00 0x00 0x00
    : I/O error: dev 08:00, sector 0

no matter what I try. I cant even clear this sector by dd if=/dev/zero
of=/dev/sda bs=512 count=1. I even booted the laptop of my collegue,
who has winXP on it, and tried to "format f:" (f: is usb removeable device),
but winXP quits with "error in IOCTL".

kernel version is 2.4.21.

root@themroc:/proc/scsi# cat /scsi 
Attached devices: 
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: Prolific Model: UsbFlashDisk     Rev: PROL
  Type:   Direct-Access                    ANSI SCSI revision: 02
root@themroc:/proc/scsi# cat usb-storage-0/0 
   Host scsi0: usb-storage
       Vendor: Prolific Technology Inc.
      Product: USB_Storage
Serial Number: None
     Protocol: 8070i
    Transport: Bulk
         GUID: 067b25170000000000000000
     Attached: Yes

root@themroc:/proc/scsi# dmesg
usb-storage: act_altsettting is 0
usb-storage: id_index calculated to be: 94
usb-storage: Array length appears to be: 97
usb-storage: USB Mass Storage device detected
usb-storage: Endpoints: In: 0xcdb29b94 Out: 0xcdb29b80 Int: 0x00000000 (Period 0)
usb-storage: Found existing GUID 067b25170000000000000000
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3

now, say I make "dd if=/dev/zero of=/dev/sda bs=512 count=1", this will
produce:

root@themroc:/proc/scsi# dd if=/dev/zero of=/dev/sda bs=512 count=1
dd: writing `/dev/sda': Input/output error
1+0 records in
0+0 records out
root@themroc:/proc/scsi# dmesg
....
usb-storage: Bulk status Sig 0x53425355 T 0x26 R 1024 Stat 0x1
usb-storage: -- transport indicates command failure
usb-storage: Issuing auto-REQUEST_SENSE
usb-storage: Bulk command S 0x43425355 T 0x27 Trg 0 LUN 0 L 18 F 128 CL 12
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 18 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 18/18
usb-storage: usb_stor_transfer_partial(): transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x27 R 0 Stat 0x0
usb-storage: -- Result from auto-sense is 0
usb-storage: -- code: 0x70, key: 0x3, ASC: 0x11, ASCQ: 0x0
usb-storage: Medium Error: (unknown ASC/ASCQ)
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
scsi0: ERROR on channel 0, id 0, lun 0, CDB: 0x28 00 00 00 00 00 00 00 02 00 
Current sd08:00: sns = 70  3
ASC=11 ASCQ= 0
Raw sense data:0x70 0x00 0x03 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x11 
0x00 0x00 0x00 0x00 0x00 
 I/O error: dev 08:00, sector 0



oops, a Medium Error :-(

so it's possible to ruin your "USB BAR" flash disk by simply dumping some
random data to /dev/sda, sector 0? not good... I've heard so that e.g.
mke2fs on a compat flash will kill the compact flash, but I've always
been wondering if this is true. now I have the proof ...

is there any way to recover the medium?

thanks in advance,
h.rosmanith

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2003-09-15 23:00 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mMAP.NQ.15@gated-at.bofh.it>
     [not found] ` <mMUh.12N.19@gated-at.bofh.it>
     [not found]   ` <mUI5.7Hp.27@gated-at.bofh.it>
2003-08-21 12:35     ` usb-storage: how to ruin your hardware(?) Ihar 'Philips' Filipau
2003-08-22  1:06       ` jw schultz
2003-08-21  1:34 H.Rosmanith (Kernel Mailing List)
2003-08-21  1:55 ` Matthew Dharm
2003-08-21  2:05   ` H.Rosmanith (Kernel Mailing List)
2003-08-21  2:35     ` Brandon Stewart
2003-08-21  6:17     ` Martin Schlemmer
2003-08-21 10:16   ` Maciej Soltysiak
2003-08-21  7:11 ` Alan Cox
2003-08-22 10:44   ` H.Rosmanith (Kernel Mailing List)
2003-08-27 15:11     ` H.Rosmanith (Kernel Mailing List)
2003-08-27 15:37       ` Richard B. Johnson
2003-08-27 19:33         ` root
2003-08-27 19:58           ` Richard B. Johnson
2003-08-28  2:59         ` H.Rosmanith (Kernel Mailing List)
2003-08-28 13:44           ` Andries Brouwer
2003-08-28 16:18             ` H.Rosmanith (Kernel Mailing List)
2003-08-28 20:25               ` Andries Brouwer
2003-08-29 10:25               ` Henning P. Schmiedehausen
2003-08-29 16:11                 ` H.Rosmanith (Kernel Mailing List)
2003-09-09  9:57                   ` Peter Werner
2003-09-15 22:57                     ` H.Rosmanith (Kernel Mailing List)
2003-08-27 16:10       ` Bas Mevissen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox