Ubuntu – Trouble with partition on a USB flash drive

gptmbrpartitioningusb-drive

Xubuntu 14.04.3, USB flash drive 4GB. After using the standard tool for writing flash drives in Linux Mint 17.2 MATE i've installed Xubuntu, but when I decided to format the flash drive i got this:

Warning: /dev/sdb 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?

Having followed these instructions:

Open a Terminal and run sudo gdisk /dev/sda
It is likely that both MBR and GPT will be found and asks you which one to use - the choice is irrelavant.
Type x for the next command because well, you're doing expert stuff
Type z to zap the GPT data
Type y to proceed destroying GPT data
Type n in order to not lose MBR data

I got this:

sudo fdisk -l

Disk /dev/sda: 400.1 GB, 400088457216 bytes
240 heads, 63 sectors/track, 51681 cylinders, total 781422768 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00087d88

 Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2046   124999679    62498817    5  Extended
/dev/sda2       124999680   781422591   328211456   83  Linux
/dev/sda5            2048     1953791      975872   82  Linux swap / Solaris
/dev/sda6         1955840    45127714    21585937+  83  Linux
/dev/sda7        45129728   124999679    39934976   83  Linux
Disk /dev/sdb: 3926 MB, 3926949888 bytes
255 heads, 63 sectors/track, 477 cylinders, total 7669824 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x53c3a606

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           0     1943551      971776    0  Empty
/dev/sdb2         1935736     1940279        2272    1  FAT12

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb1'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb1: 995 MB, 995098624 bytes
255 heads, 63 sectors/track, 120 cylinders, total 1943552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x53c3a606

 Device Boot      Start         End      Blocks   Id  System
/dev/sdb1p1   *           0     1943551      971776    0  Empty
/dev/sdb1p2         1935736     1940279        2272    1  FAT12

And this:

df
/dev/sdb1         971776    971776         0 100% /media/username/Xubuntu 14.04.3 LTS amd64
/dev/sdb2           2248         0      2248   0% /media/username/Xubuntu 14.04.3 LTS amd641

Please help restore the flash drive to a working state.
P.S. sorry for my english.

Best Answer

Fix the problem: sudo dd if=/dev/zero of=/dev/sdb bs=1M count=20 ; sync

Next: GParted--->Device--->Create Partition Table--->chose msdos