How to repartition pendrive again

opensusepartitionusb-drive

My 8GB pendrive originally contained only a FAT partition, but I tried to install OpenSUSE 11.4 on it. I created a 200MB partition for /boot and the rest was for the root partition.

Despite the minimal size of basic OS installation (490MB) I got errors during install stating the rpm couldn't unpack packages (around 20% of the install process). After several such errors (which included bash rpm) I gave up, and restarted computer.

Now I have a pendrive with no partitions at all, and I am unable to create any. fdisk fails with error "fdisk: unable to read /dev/sdc: Invalid argument", gpart fails with error "Floating point exception", Windows 7 refuses to format it, and when I check the properties I see capacity 0, used 0, available 0 space, and so on.

How can I re-partition this disk?

Edit 1

dmesg output after inserting pendrive:

[ 9980.463056] usb 1-1: new high speed USB device using ehci_hcd and address 4
[ 9980.579456] usb 1-1: New USB device found, idVendor=0930, idProduct=6544
[ 9980.579460] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9980.579462] usb 1-1: Product: TransMemory
[ 9980.579464] usb 1-1: Manufacturer: TOSHIBA
[ 9980.579466] usb 1-1: SerialNumber: 000FEAFB7A60C971F3D40B8A
[ 9980.579916] scsi12 : usb-storage 1-1:1.0
[ 9981.580536] scsi 12:0:0:0: Direct-Access     GENERIC  USB Mass Storage 1.00 PQ: 0 ANSI: 2
[ 9981.580738] sd 12:0:0:0: Attached scsi generic sg2 type 0
[ 9981.585276] sd 12:0:0:0: [sdc] READ CAPACITY failed
[ 9981.585279] sd 12:0:0:0: [sdc]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9981.585283] sd 12:0:0:0: [sdc]  Sense Key : Illegal Request [current]
[ 9981.585287] sd 12:0:0:0: [sdc]  Add. Sense: Invalid command operation code
[ 9981.585766] sd 12:0:0:0: [sdc] Write Protect is off
[ 9981.585769] sd 12:0:0:0: [sdc] Mode Sense: 65 44 09 30
[ 9981.585772] sd 12:0:0:0: [sdc] Assuming drive cache: write through
[ 9981.590519] sd 12:0:0:0: [sdc] READ CAPACITY failed
[ 9981.590522] sd 12:0:0:0: [sdc]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9981.590525] sd 12:0:0:0: [sdc]  Sense Key : Illegal Request [current]
[ 9981.590529] sd 12:0:0:0: [sdc]  Add. Sense: Invalid command operation code
[ 9981.591780] sd 12:0:0:0: [sdc] Assuming drive cache: write through
[ 9981.591783] sd 12:0:0:0: [sdc] Attached SCSI removable disk

Edit 2

Thank you for all responses. Just one clarification — it wasn't just a try to run a distro for pendrive (however I did it before and it worked). I keep linux on pendrive just for some tests, I run it once a year maybe. But today I tried to get valid boot partition, the rest of the system was not important. But of course, if this is pendrive death case, what I wanted to do with it in future didn't matter for this poor thing 🙂

Best Answer

I would suggest that your drive experienced some kind of hardware failure. The problem isn't the partitions, the problem was encountered when the drive decided to die on you. The original errors you saw during install were probably it failing to write because the disk failed to respond correctly to commands.

You can try putting it in a different machine with a different USB controller, maybe it will come to life. If you do it will probably show the partitions as they were but with corrupted data in the one you were installing to. Unfortunately once a flash drive starts to go bad it's probably a loosing battle.

Related Question