Skip to content

Instantly share code, notes, and snippets.

@daurnimator
Last active October 15, 2019 17:07
Show Gist options
  • Save daurnimator/5816924 to your computer and use it in GitHub Desktop.
Save daurnimator/5816924 to your computer and use it in GitHub Desktop.
Resizing OSX virtualbox guest partition

Expand virtual hard drive

VBoxManage modifyhd OSX\ Dev.vdi --resize 40960

Resize GPT

Solves "MediaKit reports partition (map) too small" error from Disk Utility

  • Mount virtual image via nbd sudo qemu-nbd -c /dev/nbd0 OSX\ Dev.vdi
  • Use sudo gdisk /dev/ndb0 to destroy and recreate a partition table.
  • Unmount virtual image sudo qemu-nbd -d /dev/nbd0

Fix volume information headers

Solves "Couldn't modify partition map because file system verification failed" error from Disk Utility

  • Boot OSX in single user mode (pass -s to bootloader)
  • fsck -fy

Actually resize partition

  • Boot OSX normally
  • Open Disk Utility
  • Select (now larger) drive on left
  • Partition tab
  • Drag up and then down
  • Click Apply

Done!

@fdelapena
Copy link

@ytsamy try this approach:
http://blog.kyodium.net/2010/11/increase-disk-and-partition-size-in.html
In recent OS X there are multiple entries for EFI, but read the latest comment to learn how to play with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment