Skip to content

Instantly share code, notes, and snippets.

@hervenivon
Created January 29, 2021 11:28
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hervenivon/4cf6e9d86c054aaa042030aff804e61a to your computer and use it in GitHub Desktop.
Save hervenivon/4cf6e9d86c054aaa042030aff804e61a to your computer and use it in GitHub Desktop.
A script to expand the APFS container on the boot volume with AWS EC2 Mac Instance
#!/bin/bash
PDISK=$(diskutil list physical external | head -n1 | cut -d' ' -f1)
APFSCONT=$(diskutil list physical external | grep Apple_APFS | tr -s ' ' | cut -d' ' -f8)
sudo diskutil repairDisk $PDISK
sudo diskutil apfs resizeContainer $APFSCONT 0
# https://derflounder.wordpress.com/2020/12/19/resizing-an-aws-macos-ec2-instances-boot-drive-to-use-all-available-disk-space/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment