For the original see RodsBooks
Thanks to Roderick W. Smith and additional contributers.
Text, menu partition editor, includes ability to convert MBR partition table to GPT.
sudo gdisk -l disk # Lists the partition table.
> sudo /usr/local/bin/gdisk -l /dev/disk0 GPT fdisk (gdisk) version 1.0.1 Warning: Devices opened with shared lock will not have their partition table automatically reloaded! Partition table scan: MBR: hybrid BSD: not present APM: not present GPT: present Found valid GPT with hybrid MBR; using GPT. Disk /dev/disk0: 625142448 sectors, 298.1 GiB Logical sector size: 512 bytes Disk identifier (GUID): A4EA6CAD-DDA9-400E-AA1B-7FF1F2BDF062 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 625142414 Partitions will be aligned on 8-sector boundaries Total free space is 2178782 sectors (1.0 GiB) Number Start (sector) End (sector) Size Code Name 1 40 409639 200.0 MiB EF00 EFI System Partition 2 409640 98065887 46.6 GiB AF00 Macintosh HD 3 98556832 99826367 619.9 MiB AF00 Recovery HD 4 99827712 281176527 86.5 GiB AF00 PHOTOS90 5 282446072 407457295 59.6 GiB AF00 HDIMAGES 6 407719440 496488895 42.3 GiB AF00 DATA45G 7 496751040 606991511 52.6 GiB AF00 HDIMAGES 2 8 606991512 608261047 619.9 MiB AB00 Recovery HD 9 608261048 624880263 7.9 GiB AF00 recovQ8GB 10 98125020 98494514 180.4 MiB AF00 email_cache
No modifications are written until explicitly written, quit to leave partition table unchanged.
|print partition table see -l|
|backup partition table which includes any changes made.
InvokeEnter backup filename to save: /0_160310.gpt The operation has completed successfully. ls -l /0_160310.gpt rw-r--r-- 1 root wheel 17920 Mar 10 15:00 0_160310.gpt
|verify the changed partition table|
Caution: Partition 10 doesn't begin on a 8-sector boundary. This may result in degraded performance on some modern (2009 and later) hard disks. Consult http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/ for information on disk alignment. No problems found. 2178782 free sectors (1.0 GiB) available in 8 segments, the largest of which is 1269544 (619.9 MiB) in size.
From Command (main menu) via |
Recovery/transformation command (? for help): ? l load partition data from a backup file c load backup partition table from disk (rebuilding main) e load main partition table from disk (rebuilding backup) d use main GPT header (rebuilding backup) be sure you are in Recovery/Transform menu as d is delete in main menu b use backup GPT header (rebuilding main) f load MBR and build fresh GPT from it g convert GPT into MBR and exit h make hybrid MBR t transform BSD disklabel partition o print protective MBR data Disk size is 625142448 sectors (298.1 GiB) MBR disk identifier: 0x00000000 MBR partitions: Number Boot Start Sector End Sector Status Code 1 1 625142447 primary 0xEE p print the partition table (same as from
Expert command (? for help): ? a set attributes c change partition GUID d display the sector alignment value l set the sector alignment value e relocate backup data structures to the end of the disk g change disk GUID h recompute CHS values in protective/hybrid MBR n create a new protective MBR s resize partition table t transpose two partition table entries u replicate partition table on new device z zap (destroy) GPT data structures and exit r recovery and transformation options (experts only) i show detailed information on a partition w write table to disk and exit v verify disk m return to main menu o print protective MBR data p print the partition table q quit without saving changes ? print this menu
Partition number (1-9): 1 Known attributes are: 0: system partition 1: hide from EFI 2: legacy BIOS bootable 60: read-only 62: hidden 63: do not automount Attribute value is 0000000000000000. Set fields are: No fields set Toggle which attribute field (0-63, 64 or