修复 graid 迷你磁盘上损坏的 GPT 分区

Sil*_*lex 5 linux partition gpt

我正在尝试修复 graid mini 1TB 外置硬盘上的 GPT 损坏的分区表。以下是来自 gdisk 的报告:

root@philippe-desktop:/home/philippe/thomasdisk# gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.8

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

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): ?
b   back up GPT data to a file
c   change a partition's name
d   delete a partition
i   show detailed information on a partition
l   list known partition types
n   add a new partition
o   create a new empty GUID partition table (GPT)
p   print the partition table
q   quit without saving changes
r   recovery and transformation options (experts only)
s   sort partitions
t   change a partition's type code
v   verify disk
w   write table to disk and exit
x   extra functionality (experts only)
?   print this menu

Command (? for help): v

No problems found. 262157 free sectors (128.0 MiB) available in 2
segments, the largest of which is 262151 (128.0 MiB) in size.

Command (? for help): p
Disk /dev/sdb: 1953546304 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): FE2326A4-F411-489E-B0D9-D2D9EF21A00C
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953546270
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      1953284119   931.2 GiB   AF00  G-RAID mini

Command (? for help):
Run Code Online (Sandbox Code Playgroud)

我的理解是 gdisk 能够自动解决损坏问题,只需按下即可w修复我的磁盘,但我不确定通常情况下v(验证)选项是否应该向我提出恢复选项。

我可以安全地去按w吗?我已经做了sgdisk -b backup.gpt /dev/sdb

ps:如果这个问题是题外话,请把我重定向到正确的网站

vor*_*aq7 2

如果您花几分钟阅读上面的输出,您会发现它gdisk告诉您要做什么(它发现了问题:invalid main GPT header, but valid backup;,并为您采取了行动:regenerating main header from backup!。它还提出了建议:disk verification and recovery are STRONGLY recommended.-- 您可能应该遵循该建议) 。


基于验证没有返回任何问题的事实,您可能可以正常写出分区布局 - 我的理解是gdisk将使用并写出重新生成的 GPT 数据。

如果您想明确执行操作,恢复菜单有一个选项可以使用备份 GPT 标头(重建/替换主 GPT 标头),您可以专门调用该选项,这似乎是要采取的正确操作(前提是您在上面看到的 GPT 布局看起来很正常 - 否则您可能需要手动重建分区布局)。