如何在不丢失数据的情况下将MBR分区转换为GPT?


12

我将卷分区为MBR,并且能够安装Windows 7 + Mac OSX。不幸的是,Mac OS X中的磁盘实用程序现在无法调整Mac分区的大小,因为它不是GPT卷。我也无法升级到Mountain Lion,因为它需要GPT音量。如何安全地将卷转换为GPT而不丢失数据,以便可以调整卷大小?

Answers:


9

我最终使用gdisk转换了分区。我发出:

sudo gdisk /dev/disk0

我收到了以下警告:

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

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format.
THIS OPERATON IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if
you don't want to convert your MBR partitions to GPT format!
***************************************************************

Command (? for help):

备份数据后,我编写了分区表,并自动进行了gdisk的更改,先退出(先按w,然后按q),然后重新启动。

引导到Lion是正常的,但是当我尝试使用Disk Utility调整分区表的大小时,我看到一个较小的卷头错误。

Verifying volume "Mac OS X"
Performing live verification.
Checking Journaled HFS Plus Volume.
Checking catalog file.
Checking multi-linked files.
Checking extended attributes file.
Incorrect number of extended attributes
(It should be 245871 instead of 245862)
Checking volume bitmap.
Checking volume information.
The volume Mac OS X was found to be corrupt and needs to be repaird
Error: This disk needs to be repaired...then use Disk Utility to repair this disk

好吧,我重新启动并使用-s引导进入单用户模式。从那里,我发出了一个可信赖的消息:

/sbin/fsck -fy

现在一切都很好。我的Mac OS X卷容量很合适,我可以继续升级Mountain Lion。


请注意:这并不总是有效。就我而言,Windows分区从磁盘的第2块开始,就在将要写入GPT块的位置。gdisk会对此发出警告。在我的情况下,我必须备份整个Windows分区,将其删除,然后将磁盘转换为GPT,最后还原Windows分区-这并不容易,因为它已经不适合了,所以我需要使用可以调整分区大小的工具,例如WinClone。我仍在
寻找答案中
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.