Skip to content

Instantly share code, notes, and snippets.

@jaybuidl
Last active June 18, 2023 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaybuidl/a9fc52130a972e88775d109843806fbe to your computer and use it in GitHub Desktop.
Save jaybuidl/a9fc52130a972e88775d109843806fbe to your computer and use it in GitHub Desktop.
APFS volume group creation
# Lookup your existing disks and volumes
diskutil apfs list
# We will modify diskX
disk=diskX
# Assuming that the volume diskXs1 already exist, we need to mark it as a data volume before adding it to a group.
diskutil apfs chrole ${disk}s1 D
# The volume group cannot be created directly. It will be created during the creation of the 2nd volume.
diskutil apfs addvolume ${disk} "Case-sensitive APFS" MyVolumeName -groupWith ${disk}s1 -role D
# (to create a system disk instead, set `-role S` in the above command)
# Now the volume group should show up
diskutil apfs listGroups
# Note: the Disk Utility desktop app does not always refresh correctly. Restarting the app or unmounting/reconnecting should help.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment