Skip to content

Instantly share code, notes, and snippets.

@aorjoa
Created October 22, 2015 19:30
Show Gist options
  • Save aorjoa/5fe0c46920f164990020 to your computer and use it in GitHub Desktop.
Save aorjoa/5fe0c46920f164990020 to your computer and use it in GitHub Desktop.
Gdisk for fixed MBR boot Mac OS (rEFIt)
$ sudo gdisk /dev/disk0
Password:
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.
Command (? for help): r
Recovery/transformation command (? for help): p
Disk /dev/disk0: 468862128 sectors, 223.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 995122FD-2DA6-484A-B911-1E3FDB93FBBA
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 468862093
Partitions will be aligned on 8-sector boundaries
Total free space is 1980 sectors (990.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00 EFI System Partition
2 409640 437880471 208.6 GiB AF00 Macintosh HD
3 437880472 439150007 619.9 MiB AB00 Recovery HD
4 439150008 440419543 619.9 MiB AF00 Recovery HD
5 440420352 440422399 1024.0 KiB 8300
6 440422400 461004799 9.8 GiB 8300
7 461004800 468860927 3.7 GiB 8200
Recovery/transformation command (? for help): h
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 2 6
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): Y
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default AF):
Set the bootable flag? (Y/N): Y
Creating entry for GPT partition #6 (MBR partition #3)
Enter an MBR hex code (default 83):
Set the bootable flag? (Y/N): N
Unused partition space(s) found. Use one to protect more partitions? (Y/N): Y
Note: Default is 0xEE, but this may confuse Mac OS X.
Enter an MBR hex code (default EE):
Recovery/transformation command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/disk0.
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Caution: More than one 0xEE MBR partition found. This can cause problems
in some OSes.
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment