Question Ubuntu/Debian tools to recover a frozen USB stick?

May 12, 2020
67
0
40
0
I dd'ed a USB thumb drive with an ISO image (in preparation for an installation), and the drive got unusable (readable, but the GPT is not writable). The most likely cause is that the drive was automounted, and I didn't notice it while dd'ing.
How can I reinitialize the drive in Ubuntu (or, as a second choice, in Debian)? When I plug in the drive and try

dd if=/dev/zero of=/dev/sdb

I get the following output in dmesg:

Code:
[   60.097654] usb 3-3: new high-speed USB device number 4 using xhci_hcd
[   60.253359] usb 3-3: New USB device found, idVendor=058f, idProduct=6387, bcdDevice= 1.02
[   60.253364] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   60.253367] usb 3-3: Product: Mass Storage
[   60.253369] usb 3-3: Manufacturer: Generic
[   60.253371] usb 3-3: SerialNumber: 3FE94C58
[   60.276349] usb-storage 3-3:1.0: USB Mass Storage device detected
[   60.276440] scsi host5: usb-storage 3-3:1.0
[   60.276528] usbcore: registered new interface driver usb-storage
[   60.280951] usbcore: registered new interface driver uas
[   61.281075] scsi 5:0:0:0: Direct-Access     Generic  Flash Disk       8.07 PQ: 0 ANSI: 4
[   61.281884] sd 5:0:0:0: Attached scsi generic sg2 type 0
[   61.282640] sd 5:0:0:0: [sdb] 4014080 512-byte logical blocks: (2.06 GB/1.91 GiB)
[   61.283348] sd 5:0:0:0: [sdb] Write Protect is off
[   61.283355] sd 5:0:0:0: [sdb] Mode Sense: 23 00 00 00
[   61.284064] sd 5:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   61.312518]  sdb: sdb1 sdb2
[   61.314679] sd 5:0:0:0: [sdb] Attached SCSI removable disk
[  193.604355]  sdb: sdb1 sdb2
[  193.835425] sd 5:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[  193.835428] sd 5:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[  193.835430] sd 5:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[  193.835432] sd 5:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 00 00 00 00 00 28 00
[  193.835434] blk_update_request: I/O error, dev sdb, sector 0 op 0x1:(WRITE) flags 0x0 phys_seg 5 prio class 0
[  193.836207] Buffer I/O error on dev sdb, logical block 0, lost async page write
[  193.836913] Buffer I/O error on dev sdb, logical block 1, lost async page write
[  193.837525] Buffer I/O error on dev sdb, logical block 2, lost async page write
[  193.838117] Buffer I/O error on dev sdb, logical block 3, lost async page write
[  193.838702] Buffer I/O error on dev sdb, logical block 4, lost async page write
[  193.848109] sd 5:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
I already tried hdparm -r0 /dev/sdb and sg_format --format /dev/sdb and the tool mkusb/dus. Here is some more data:

# hdparm /dev/sdb

/dev/sdb:
SG_IO: bad/missing sense data, sb[]: f0 00 05 00 00 00 00 0a 00 00 00 00 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
multcount = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 1011/64/62, sectors = 4014080, start = 0
# sg_modes /dev/sdb
Generic Flash Disk 8.07 peripheral_type: disk [0x0]
Mode parameter header from MODE SENSE(10):
Mode data length=8, medium type=0x00, WP=0, DpoFua=0, longlba=0
Block descriptor length=0
 
Last edited:

ASK THE COMMUNITY

TRENDING THREADS