Skip to content

Instantly share code, notes, and snippets.

@tylerflint
Forked from joost/resize_boot2docker.sh
Last active December 6, 2016 19:50
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 tylerflint/a971b891e88645a5ca26267c0a9eb588 to your computer and use it in GitHub Desktop.
Save tylerflint/a971b891e88645a5ca26267c0a9eb588 to your computer and use it in GitHub Desktop.
Resize Nanobox VirtualBox image
# Steps we will take:
# 1. Change virtualbox image type (this will take a bit)
# 2. Resize image
# 3. Resize partion (using GParted)
#
# Stop nanobox
nanobox stop
# First we need to change the size of the image.
# Convert the VMDK image to VDI (one that we can resize). This will take some time.
vboxmanage clonehd "~/.docker/machine/machines/nanobox/disk.vmdk" "~/.docker/machine/machines/nanobox/disk.vdi" --format vdi
# Resize (the size was ~15Gb) to 30Gb. This will be fast.
vboxmanage modifyhd "~/.docker/machine/machines/nanobox/disk.vdi" --resize 30720
# Next we need to change the partition size to use our resized image
# Install GParted on your boot2docker vm:
# - Download GParted ISO from http://gparted.sourceforge.net
# - Open VirtualBox
# - Go to: nanobox > Settings > Storage
# - Add an IDE controller
# - Add your downloaded GParted ISO as CD/DVD
# - (boot2docker itself also is an ISO, do NOT remove it)
# - Add your VDI to the SATA controller as Harddisk
# - Remove the VMDK partition
# Start GParted:
# - Boot your nanobox vm (it should boot from the GParted ISO/CD)
# - Choose all defaults
# Resize the partition (in the GUI):
# - Right click > Resize on the boot2docker-data partition
# - Drag the slider to increase the partition/volume
# - Click Resize/Move
# - Click Apply > and one last time :) (this wont take long)
# - Quit and Shutdown
# Next remove GParted:
# - Go to: VirtualBox > nanobox > Settings > Storage
# - Remove the IDE controller (and thus the GParted ISO)
# Done!
# After this you can start nanobox normally
nanobox start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment