修复GPT表损坏的32GBU盘问题
修复GPT表损坏的32GBU盘问题
看起来你在使用TransMac操作后,32GB的U盘出现了GPT分区表损坏的问题:备份GPT头无效、主备分区表不匹配,导致现有两个分区无法删除,还剩下大量未分配空间。结合你给出的gdisk和fdisk诊断信息,我给你提供两种可靠的修复方案:
方案一:修复GPT分区表结构(尝试保留数据)
如果还想尝试保留U盘里的数据,先优先修复损坏的GPT表:
- 打开终端,运行
gdisk /dev/sdb(务必确认/dev/sdb是你的U盘!可以先用lsblk命令核对设备信息,千万别选错系统盘) - 进入gdisk界面后,输入
x切换到专家模式 - 输入
e,选择从主GPT表恢复备份GPT表(你的主分区表是正常的,仅备份表损坏) - 输入
w保存更改,按提示确认写入操作,修复完成后重新查看分区状态即可
方案二:彻底重置U盘(清除所有数据)
如果不需要保留数据,直接重置分区表是最彻底的解决方法,有两种工具可选:
用gdisk重置:
- 运行
gdisk /dev/sdb - 输入
o,创建全新的空GPT分区表,按Y确认操作 - 输入
w保存更改,此时原有分区会被全部清除,U盘回到未初始化状态
用fdisk重置(备选方案):
- 运行
fdisk /dev/sdb - 输入
g,创建新的GPT分区表 - 输入
w保存更改,同样会清除所有分区数据
后续操作
重置完成后,你就可以用GParted或者系统自带的磁盘工具重新分区格式化,正常使用U盘了。
附你提供的诊断信息:
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+
备注:内容来源于stack exchange,提问作者TwentySix
相关产品推荐
相关产品推荐

