It's possible your partition tables have become corrupted this can happen for many reasons but I have a possible solution that may help anyone who comes across a USB device where disk utilities or
gparted throws you errors when trying to format or partition a faulty USB device.
I've pulled my hair out trying to sort out numerous USB devices that I have corrupted with Ubuntu 12.04.
Ok let's get started.
Plug in your faulty USB device and start up disk utility you can find it by typing disk utility in the Dash home icon very top left left coroner of the Unity Dash board.
Once it's open look on the left hand side and locate your faulty USB device click on it and a page will open, on the right hand side of the screen you should see Device: then what should look like
/dev/sdb or maybe
/dev/sdb1 depends on what your screen says.
Open up the terminal by pressing Ctrl+Alt+T now type:
sudo fdisk /dev/sdb where you see
/dev/ this is where you type what you saw on the disk utility screen so if it said
/dev/sdb1 on the disk utility screen then the command would be
sudo fdisk /dev/sdb1
STOP After typing
sudo fdisk /dev/sdb if the terminal gives you the following
fdisk: unable to open /dev/sdb: No medium found" Your device is BRICKED, the following commands won't help you in Ubuntu! STOP
Now enter the following commands:
n and hit Enter
p and hit Enter
1 and hit Enter
Now it will ask you where to start the sector/cylinder just hit enter then it will ask you where to end, again just hit enter where going to let it use the default fields.
w and hit Enter
You should now see:
The partition table has been altered!
If you see this were in business!
Now you should be out of
fdisk and back at your home terminal. Now type:
sudo mkfs -t ext3 /dev/sdb or like I said above if in disk utility it said something else then the command would end with
/dev/? Whatever disk utility said the device name was.
Ok now exit the "terminal" by typing exit then hit enter. Go back to disk utility and eject the device if it doesn't allow you make sure
gparted is not running or any other program that might be interacting with the USB device like the "terminal".
Once the USB device is safely ejected plug the device back in and look at the disk utility program again and open the device once it registers now go to format volume and try to format the volume to FAT with whatever volume name you like. If all goes according to plan the device will format to FAT and you will now be able to control the USB device normally.
So now you should be able to reformat and control the USB to whatever format you like.
For those that are wondering why at
sudo mkfs -t ext3 /dev/sdb I didn't just make the device fat instead of ext3 for some reason in Ubuntu after I tried fat instead of ext3 I wasn't able to control the device in disk utilities the same way as the method I described maybe a bug I'm not sure but all my USB devices are now free from errors.
Hope this helps someone.