Wednesday, 6 March 2019

macos - How can I convert a MBR partition to GPT without loss of data?


I partitioned my volume as MBR and was able to install Windows 7 + Mac OS X. Unfortunately, Disk Utility in Mac OS X cannot resize the Mac partition now because it's not a GPT volume. I also cannot upgrade to Mountain Lion because it requires a GPT volume. How can I safely convert the volume to GPT without data loss so that I can resize my volumes?



Answer



I ended up using gdisk to convert the partition. I issued:


sudo gdisk /dev/disk0

And I was greeted with this warning:


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

After backing up my data, I wrote the partition table with the changes gdisk made automatically, quit (w, then q), and rebooted.


Booting into Lion was normal, but when I tried to resize my partition table with Disk Utility, I saw that I had a minor volume header error.


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

Well, I rebooted and used -s to boot into single user mode. From there, I issued a trusty:


/sbin/fsck -fy

Now all is well. I have a happily resized Mac OS X volume, and I can proceed with my Mountain Lion upgrade.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...