Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Baron Bifford
May 24, 2006
Probation
Can't post for 2 years!
I created in Linux a bootable USB stick to install Linux Mint on my PC. Now that I'm finished, I want to wipe the stick and restore it to its factory state so that I can use it for regular stuff like moving files. I tried doing this using the Disks tool as well as GParted, but they complained. They said something about the sticks appearing to be GPT but not having a faked MBR table or something like that. Anyway, they refuse to reformat the stick.

Disks gives this error message when I try to delete partitions:

quote:

Error deleting partition /dev/sdc1: Command-line `parted --script "/dev/sdc" "rm 1"' exited with non-zero exit status 1: Warning: /dev/sdc contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables. Or perhaps you deleted the GPT table, and are now using an msdos partition table. Is this a GPT partition table?
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
Warning: Not all of the space available to /dev/sdc appears to be used, you can fix the GPT to use all of the space (an extra 27542656 blocks) or continue with the current setting?
Error: Unable to satisfy all constraints on the partition.
(udisks-error-quark, 0)

In GParted, the Linux Mint partitions do not appear at all when I inspect the USB stick.

How do I fix this?

For reference, in its original state this USB stick had a single 16GB FAT32 partition with an MBR partition table.

Baron Bifford fucked around with this message at 16:29 on Oct 26, 2015

Adbot
ADBOT LOVES YOU

Gorson
Aug 29, 2014

Have you tried DISKPART (windows command line)?

Fruit Smoothies
Mar 28, 2004

The bat with a ZING
GParted should be able to make a new partition table.

CaptainSarcastic
Jul 6, 2013



Did you try just deleting the partitions in Gparted? Also, you should be able to turn off the boot flag in Gparted, too, which might let you delete and then format.

telcoM
Mar 21, 2009
Fallen Rib
If your USB stick (whole-device) is /dev/sdc, the following command will overwrite the partition table with zeroes.

WARNING: this won't ask for confirmation.
It will overwrite the first megabyte of whatever device it is pointed at.
So be very sure you point it at the right device.

code:
sudo dd if=/dev/zero of=/dev/sdc bs=1k count=1024
I'm guessing the stick was created by dd'ing an isohybrid image onto it, or something similar.

That is probably why parted says not all space is used (because the image was smaller than the total capacity of the stick) and why it thinks the backup GPT partition table is corrupt (because the backup GPT is at the end of the image, and the true end of the device contains just unused space). But that means we can get away with just overwriting the start of the stick: after that, the partitioning tools should have no clue that there is a remaining backup GPT somewhere in the middle of the stick.

  • Locked thread