Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Created April 9, 2017 17:46
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 rtrouton/1adf016fc5306ccc6d7308813609f1b0 to your computer and use it in GitHub Desktop.
Save rtrouton/1adf016fc5306ccc6d7308813609f1b0 to your computer and use it in GitHub Desktop.
diskutil repairDisk script for fixing a VM boot disk's partition map.
#!/bin/bash
# Fix VM boot disk's partition map. This is necessary
# to allow the boot drive to grow after cloning a VMDK.
#
# Issue documented here:
# https://kb.vmware.com/kb/2069255
# http://osxadmin.blogspot.com/2014/03/expand-os-x-virtual-disk-in-esxi.html
# repairDisk asks for a y/n confirmation before running,
# so the yes command is piped into the command to answer
# "yes" to the confirmation dialog.
/usr/bin/yes | /usr/sbin/diskutil repairDisk /dev/disk0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment