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 /dev/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
testdisk
manual recoveryPartition 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 in memory. ***** Disk /dev/sdb: 976773168 sectors, 465.8 GiB Logical sector size: 512 bytes Disk identifier (GUID): 5093F812-240C-4D50-8098-A343165D167C4 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 976773134 Partitions will be aligned on 8-sector boundaries Total free space is 133967916 sectors (63.9 GiB) Number Start (sector) End (sector) Size Code Name 1 2048 206847 100MiB 0700 Microsoft basic data 2 206911 115392511 54.9 GiB 3 missing 4 946120704 948932607 1.3 5 146120704 179912703 16.1 6 179916800 180936703 .498 7 180938752 197322751 7.8 8 197324800 234188799 17.6 9 234190849 255.9 10 770861056 1 11 772911104 40 12 907976704 1 13 910026752 3 14 926550616 .1 15 940802048 2.5
No modifications are written implicitly.
Until explicitly written with w
use quit to leave partition table unchanged.
p | print partition table see -l | ||||||||||||||||||||||
v | verify the changed partition tableCaution: 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 ibm.com/developerworks/linux/library/l-4kb-sector-disks/ for information on disk alignment. |
From Command (main menu) via r
Recovery/transformation command (? for help): ?
| |||||||||||||||||||||||||||||||
l | load partition data from a backup file Enter backupfilename to load: | ||||||||||||||||||||||||||||||
c | load backup partition table from disk (rebuilding main) Waning! This will probally do weird things if you've converted an MBR to GPT form and haven't yet saved the GPT: Proceed? (Y/N) | ||||||||||||||||||||||||||||||
e |
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 sector 0, precedes the GPT, MBR contains one type 0xEE partition that spans the entire length of the disk. It protects GUID Partition Table disks from previously-released MBR disk tools such as Microsoft MS-DOS FDISK or Microsoft Windows NT Disk Administrator. 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 | |||||
a | set attributes
Partition number (1-9): 1 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 |