首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我意外地重写了我的GPT,如何用gdisk恢复它?

我意外地重写了我的GPT,如何用gdisk恢复它?
EN

Ask Ubuntu用户
提问于 2015-03-11 13:59:28
回答 3查看 16.8K关注 0票数 3

gpt fdisk问题

我有一个日立驱动器,它的GPT损坏了,它是从一台不到一年的Windows 8计算机中出来的。这在很大程度上保证了它处于EFI模式,对吗?

我正在试图恢复日立1TB驱动器上的GPT文件结构。我不是计算机专家,但对于新手来说,我相当熟练,能够解决大多数计算机问题,并遵循明确的指示。

我试图修复我儿子的电脑,于是我拿出他的硬盘,试图重新格式化。它没有重新格式化外部驱动器1,而是重新设置了内部驱动器0,因此我失去了我的OS和C分区。

我有驱动器,并连接到我的笔记本电脑,试图修复文件结构。

我已经附上了我的初步发现使用GPT。当我选择选项2重建GPT时,它说分区重叠。

我对这意味着什么或下一步是什么感到困惑。

如果你能提供任何帮助,我将不胜感激。

下面是我运行gdisk时得到的信息:

代码语言:javascript
复制
GPT fdisk (gdisk) version 0.8.10

Type device filename, or press <Enter> to exit: 1:
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

Warning! Read error 0! Misbehavior now likely!
Caution! After loading partitions, the CRC doesn't check out!
Warning! Error 0 reading partition table for CRC check!
Warning! One or more CRCs don't match. You should repair the disk!

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

Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT

Your answer: 2
Warning! Main partition table overlaps the first partition by 34 blocks!
You will need to delete this partition or resize it in another utility.

Warning! Secondary partition table overlaps the last partition by
15650193771697010572 blocks!
You will need to delete this partition or resize it in another utility.

Command (? for help): e
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): l
0700 Microsoft basic data  0c01 Microsoft reserved    2700 Windows RE
3000 ONIE boot             3001 ONIE config           4100 PowerPC PReP boot
4200 Windows LDM data      4201 Windows LDM metadata  7501 IBM GPFS
7f00 ChromeOS kernel       7f01 ChromeOS root         7f02 ChromeOS reserved
8200 Linux swap            8300 Linux filesystem      8301 Linux reserved
8302 Linux /home           8400 Intel Rapid Start     8e00 Linux LVM
a500 FreeBSD disklabel     a501 FreeBSD boot          a502 FreeBSD swap
a503 FreeBSD UFS           a504 FreeBSD ZFS           a505 FreeBSD Vinum/RAID
a580 Midnight BSD data     a581 Midnight BSD boot     a582 Midnight BSD swap
a583 Midnight BSD UFS      a584 Midnight BSD ZFS      a585 Midnight BSD Vinum
a800 Apple UFS             a901 NetBSD swap           a902 NetBSD FFS
a903 NetBSD LFS            a904 NetBSD concatenated   a905 NetBSD encrypted
a906 NetBSD RAID           ab00 Apple boot            af00 Apple HFS/HFS+
af01 Apple RAID            af02 Apple RAID offline    af03 Apple label
af04 AppleTV recovery      af05 Apple Core Storage    be00 Solaris boot
bf00 Solaris root          bf01 Solaris /usr & Mac Z  bf02 Solaris swap
bf03 Solaris backup        bf04 Solaris /var          bf05 Solaris /home
bf06 Solaris alternate se  bf07 Solaris Reserved 1    bf08 Solaris Reserved 2
bf09 Solaris Reserved 3    bf0a Solaris Reserved 4    bf0b Solaris Reserved 5
c001 HP-UX data            c002 HP-UX service         ea00 Freedesktop $BOOT
eb00 Haiku BFS             ed00 Sony system partitio  ed01 Lenovo system partit
Press the <Enter> key to see more codes:
ef00 EFI System            ef01 MBR partition scheme  ef02 BIOS boot partition
fb00 VMWare VMFS           fb01 VMWare reserved       fc00 VMWare kcore crash p
fd00 Linux RAID

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):  
EN

回答 3

Ask Ubuntu用户

发布于 2015-03-12 00:50:19

GPT (gdisk)确实可以修复许多GPT问题;但是您显示的输出几乎毫无用处;您已经显示了命令列表(两次)和gdisk支持的分区类型代码列表,这两种代码都不是您的系统所独有的。相反,请向我们展示pv命令显示的有关磁盘的内容。您还应该阅读gdisk关于修复GPT磁盘的文档。

您展示的是诊断性的gdisk输出是前几行,这表明您有一个损坏的主GPT头,但损坏的备份;但是(据称未损坏的)主要的GPT数据结构显示出荒谬的重叠,表明这里也有损坏。如果没有看到pv的输出,我就不能确定,但这表明主要的GPT数据可能已经损坏。解决这个问题可能有可能,也可能不可能。也可能值得加载备份数据,以查看其相似之处,以及检查备份数据。

在最坏的情况下,正如gedelat所建议的那样,可能有必要使用TestDisk;但您应该将此视为最后的恢复方法。

票数 4
EN

Ask Ubuntu用户

发布于 2019-08-06 09:50:04

@gadelat,罗德·史密斯:"Hash of things“在这种情况下指的是使用testdisk:事情更糟了!

testdisk有时会导致猜测部件的错误结果(特别是在过去用作Raid/LVM的磁盘上)。

首先尝试使用所有的测试模式(例如-n):

代码语言:javascript
复制
gpart, fsck.ext3 -b <alternate super block> device

等。

票数 0
EN

Ask Ubuntu用户

发布于 2015-03-11 18:21:23

解决这类问题的好工具是实用程序测试盘。试试看。

票数 -2
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/595535

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档