怎么恢复GPT分区表啊?

启动讨论 grub/grub2/syslinux/grub4dos/Lilo
回复
fatbird
帖子: 33
注册时间: 2012-05-14 11:46
系统: ubuntu fedora

怎么恢复GPT分区表啊?

#1

帖子 fatbird » 2014-02-21 0:01

手贱一不小心在ubuntu里面把GPT分区表弄坏了,怎么修复啊?
ubuntu下面

代码: 全选

sudo gdisk /dev/sda
然后输入r进入二级目录
然后输入f
再输入w保存
退出重启之后,就启动不了了。
认真看了一下gdisk 的文档才发觉gdisk下的f与fdisk下输入f用处不一样。
gdisk下输入f Load MBR and build fresh GPT from it. Use this option if your GPT is corrupt or conflicts with the MBR and you want to use the MBR as the basis for a newset of GPT partitions.大概意思是加载MBR并新建一个GPT分区表。
因为英文不太好,还以为和fdisk一样是修复分区顺序。
现怎么恢复GPT以前的分区表啊?ubuntu里面好有好多东西没有备份,咋办啊! :em21
头像
zhw2101024
帖子: 1849
注册时间: 2009-03-28 16:10
系统: Arch debian win7
联系:

Re: 怎么恢复GPT分区表啊?

#2

帖子 zhw2101024 » 2014-02-21 2:55

testdisk有没有试过?
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 怎么恢复GPT分区表啊?

#3

帖子 poloshiao » 2014-02-21 9:52

看看 這一篇能否 幫你
http://ubuntuforums.org/showthread.php?t=1956173

如果有重要資料在 分割區內
暫時 不要掛載 分割區 或 寫入分割區
這樣才不會不小心闖下無法救回的情形

進一步參閱
http://www.rodsbooks.com/gdisk/
http://manpages.ubuntu.com/manpages/pre ... isk.8.html
头像
onshoestring
论坛版主
帖子: 4666
注册时间: 2009-09-06 5:53

Re: 怎么恢复GPT分区表啊?

#4

帖子 onshoestring » 2014-02-21 10:22

gpt分区表在磁盘结尾处有一个备份(如果是mbr转gpt则没有备份)
gdisk
c
Load backup partition table.装载备份分区表
p
Print the partition table.显示,查看正确否?
w
Write table to disk and exit.正确就写人
fatbird
帖子: 33
注册时间: 2012-05-14 11:46
系统: ubuntu fedora

Re: 怎么恢复GPT分区表啊?

#5

帖子 fatbird » 2014-02-21 23:05

研究了一下,估计是恢复不了了。
我手贱当时我使用gdisk /dev/sda
r
recovery and transformation options (experts only)
f
load MBR and build fresh GPT from it (加载并建立一个新的GPT格式)
w
Write table to disk and exit.

用onshoestring的方法回复不了了,不是分区表损坏,是我自己建立了一个新的GPT,估计自动在尾部备份的也更新了。
估计除非自己另外备份的有分区表不然估计是没办法回复了吧?挂windows下面用DiskGenius倒是能扫描出以前划分的一个NTFS文件系统的分区。ubuntu下的文件系统分区扫描不出来,可惜还没有在NTFS的分区下保存资料,都是放在ubuntu下的这下完蛋了。 :em48
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 怎么恢复GPT分区表啊?

#6

帖子 poloshiao » 2014-02-21 23:38

看看 這個能否幫你
http://www.rodsbooks.com/gdisk/repairing.html
Use the 'o' option on GPT fdisk's experts' menu to obtain the start sector and length of the affected partition. You can then re-create the partition, entering those values.
fatbird
帖子: 33
注册时间: 2012-05-14 11:46
系统: ubuntu fedora

Re: 怎么恢复GPT分区表啊?

#7

帖子 fatbird » 2014-02-23 10:41

poloshiao 写了:看看 這個能否幫你
http://www.rodsbooks.com/gdisk/repairing.html
Use the 'o' option on GPT fdisk's experts' menu to obtain the start sector and length of the affected partition. You can then re-create the partition, entering those values.
没办法恢复了,已经重新安装了。谢谢!下次要要弄分区表时我还是先备份一份出来才行啊!
回复