Skip to content

Instantly share code, notes, and snippets.

Last active Oct 15, 2019
What would you like to do?
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


Copy link

ytsamy commented May 21, 2014

I've followed your instructions as closely as I could, but when I boot OSX, the drive is still the previous (smaller) size.
One point is not very clear to me: how to destroy and recreate the partition table. I ran the command (gdisk....) and then quit, but the disk size does not change in OSX.
If I try to make further manipulations in gdisk (deleting and re-adding the partitions), I can no longer boot OSX to single user mode: it keeps saying "still waiting for root device". I forgot to mention It's my root partition that I want to make larger.
Can you help me?

Copy link

fdelapena commented Jun 13, 2015

@ytsamy try this approach:
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