Score:0

Fix USB flash drive with corrupt GPT table

us flag

I have a problem with USB flash drive (32GB) after unsuccess TransMac usage. Now the flash drive contains two partitions that can't be deleted and an empty space.

gdisk:

root@user-virtual-machine:/home/user# gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.8

Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.

Warning! One or more CRCs don't match. You should repair the disk!
Main header: OK
Backup header: ERROR
Main partition table: OK
Backup partition table: ERROR

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Command (? for help): p
Disk /dev/sdb: 62656641 sectors, 29.9 GiB
Model: Flash Drive FIT 
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 44FBDEB4-5E34-46A6-8849-4B3894C93E5D
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 18256190
Partitions will be aligned on 8-sector boundaries
Total free space is 262157 sectors (128.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640        17994039   8.4 GiB     AF00  disk image

fdisk:

root@user-virtual-machine:/home/user# fdisk /dev/sdb -l
GPT PMBR size mismatch (18256223 != 62656640) will be corrected by write.
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
The backup GPT table is not on the end of the device.
Disk /dev/sdb: 29,88 GiB, 32080200192 bytes, 62656641 sectors
Disk model: Flash Drive FIT 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 44FBDEB4-5E34-46A6-8849-4B3894C93E5D

Device      Start      End  Sectors  Size Type
/dev/sdb1      40   409639   409600  200M EFI System
/dev/sdb2  409640 17994039 17584400  8,4G Apple HFS/HFS+

GParted:

enter image description here enter image description here enter image description here

oldfred avatar
cn flag
Disk images like ISO, often only write to the beginning of a drive and may not update gpt's backup partition table at the end. I would run gdisk and update. With gdisk you use the w command to write protective MBR, primary partition table & backup. Not sure exact commands to use in parted or gparted. More repair info use p, v & w to write the partition table. If not correct just use q to quit. : http://askubuntu.com/questions/386752/fixing-corrupt-backup-gpt-table/386802#386802
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.