0

I was testing out various operating systems on a spare laptop, flashing a USB thumb drive with various bootable images in order to do so. At some point something got messed up, and the drive is now so screwed up I can't even delete the bad partition. The drive mounts correctly (it appears in my file manager and I can look through the files) but I can't reformat it or delete the existing partition to use it as a normal thumbdrive again.

When I open gparted, I immediately get the message:

The backup GPT table is corrupt, but the primary appears OK, so that will be used.

The drive has one partition /dev/sda1, and a bunch of unallocated space. I unmount the partition in gparted and try to delete the partition. While deleting the partition, the same error appears again, along with:

Input/output error during write on /dev/sda

gparted then claims the partition was deleted successfully, but it still appears in the partition list afterwards, with various errors in the "Information" dialog:

Can't open /dev/sda1: No such file or directory

Cannot initialize '::'

mlabel: Cannot initialize drive

fsck.fat 4.1 (2017-01-24)

open: No such file or directory

I don't care about any of the data on the drive. Is there a way I can nuke it back into a usable state?

Jack M
  • 1,310
  • 2
  • 16
  • 32
  • Can you format it using a windows or mac machine? – ldias May 22 '20 at 12:38
  • 2
    I had the exact same problem happen to a MicroSD card I had. It actually went defective and all I could do is backup the data off it and then purchased a new one. Flash media really is only good for so many writes then that is it. – Terrance May 22 '20 at 12:43
  • @Terrance This is true, but this thumbstick doesn't get heavy use. Okay I probably formatted it five or six times yesterday, but I don't think the lifespan on a USB stick is that short. – Jack M May 22 '20 at 12:50
  • 2
    You can try this: Reset USB flash that was dd'd to make it usable again https://askubuntu.com/questions/939230/formatting-a-usb-stick-unable-to-operate-usb/939266#939266 & https://help.ubuntu.com/community/mkusb#Re-use_the_pendrive – oldfred May 22 '20 at 13:26
  • 1
    @oldfred No luck. mkusb's wipe (w) command just hung forever making no progress, and the restore (r) command behaved similarly to gparted - appeared to go through, but symptoms persist after unplugging and replugging the drive. – Jack M May 22 '20 at 14:11
  • 3
    Looks like you have conclusively demonstrated that your USB stick is dying or faulty. Since you wrote that it's fairly new, contact your vendor or manufacturer for a warranty replacement. – user535733 May 22 '20 at 14:19
  • 1
    I have had better luck formatting flash drives in Disks than in gparted. especially if they have been formatted ISO9660 as SDC makes. – C.S.Cameron May 22 '20 at 15:16

1 Answers1

0

Instead of gParted, I'd suggest using Disks in Ubuntu as I have had much better luck with misbehaving USB flash drives with it.

Launch it, then select the LiveUSB, and click on the - button, then create a new partition tabel and partition with its + button.

K7AAY
  • 17,202