Skip to content

Instantly share code, notes, and snippets.

@1isten
Created December 1, 2018 17:59
Show Gist options
  • Save 1isten/d4c40ca5ed42492f694e05508f26b628 to your computer and use it in GitHub Desktop.
Save 1isten/d4c40ca5ed42492f694e05508f26b628 to your computer and use it in GitHub Desktop.
sudo gpt -r show disk0 ->
Mackintosh HD part is 234045360 blob => 234045360*512 = 119831224320 B = 119.83122432 GB
***
How to convert between Gigabytes and Gibibytes (GB & GiB)?
1 GB = 0.931322574615 GiB
1 GiB = 1.073741824 GB
***
Apple prefers GB while Microsoft prefers GiB, for example I want a perfact Windows partision with size of 50.00G(from the view of Windows) on my Mac:
so, 119.83122432 GB x 0.931322574615 GiB = 111.601524353 Gibibytes.
+--------------------------------------------------------------+
| total = 119831224320 B = 119.83122432 GB = 111.601524353 GiB |
| win = 50 GiB |
| left = 66.14413312 GB = 61.601524353 GiB |
+--------------------------------------------------------------+
diskutil apfs list -> find container is disk1 --> diskutil apfs resizeContainer disk1 66.14413312G
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment