1

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.

2

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

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

  • 2
    Finally! After hours of complicated solutions that don't work, something so simple that works. Change sdb in your answer to sdy with a note y should be replaced with b, c, d, etc representing the drive. – WinEunuuchs2Unix Oct 10 '16 at 20:11
0

Depending on how you create them, USB flash drives with Ubuntu (or other Linux distribution) installers can use a sort of Frankenstein's Monster of partition tables. You may be able to re-use the disk by writing a fresh image to the disk using dd, or possibly some other tool. If you want to use the disk for other purposes, or if the tool you use balks, you must completely wipe the partition table. One relatively easy way to do this is with sgdisk:

sudo sgdisk -Z /dev/sdc

Be careful with that command! A slip-up could seriously damage your hard disk! Pay particular attention to the disk device (/dev/sdc in this example).

This example wipes the GUID Partition Table (GPT) on /dev/sdc. Change /dev/sdc to the appropriate device. (Since MBR's critical data structures occupy a subset of the space consumed by GPT, the MBR data will also be wiped by this command.)

Note that /dev/sdb1 in your example is not a disk device; it's a partition. Whole-disk device names in Linux usually take the form /dev/sdx, where x is a letter. Adding a number, as in /dev/sdb1, means the reference is to a partition.

Wiping the first 20MiB of the disk, as in user413594's answer, will probably do the trick; but that both wipes much more data than necessary and does not wipe the backup partition table, if the disk uses (or ever used) GPT. This failure to wipe the backup GPT data could cause confusion down the road, should any disk utility look for and find this old data.

After you wipe the old partition table, you can use any tool you like (gdisk, parted, fdisk, GParted, etc.) to create a new partition table. Depending on the tool you use, you might then need to use mkfs or a related tool to create a new filesystem on the partition you create.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.