Expanding the Bitcraze VM 0.5 Main Partition

Expanding the Bitcraze VM 0.5 Main Partition

I had been meaning to post a tutorial on how I expanded the main partition on the Bitcraze 0.5 virtual machine. A few months back I had to do it myself since I’d wanted to upgrade the VM to a newer version of Ubuntu. As it is, the VM drive doesn’t have enough space to do the upgrade. On July 17, 2014, Ubuntu officially dropped support for Ubuntu 13.10 (the version that the Bitcraze Xubuntu VM is based on) and with the end-of-life so goes the supportability (ie. no more security updates). For most it’s probably not a big deal. The VM will run just fine even if Ubuntu isn’t offering regular updates. For others however, staying up-to-date is important so it’s nice to have an upgrade potential.

You can resize that virtual disk in a virtual machine manager (like VirtualBox or VMWare) but that’s not enough to expand the main partition. The situation is complicated a bit by the fact the swap partiton is separating the linux partiton from all the juicy unallocated space that gets created when you resize the virtual disk. It’s possible, just not entirely straight forward, to fix the situation, so I’ve created this tutorial post in an effort to assist would be drive expanders.

This tutorial is about how to expand the hard drive if you’re using VMWare Fusion on Mac. The portions about GParted and moving partitions around will apply to other virtual machine managers as well.

First things first, if you don’t have a snapshot of your virtual machine, shut it down and make one now, just in case things go wildly array. It might also be a good idea to make a copy of the virtual machine image for a backup. Ok, let’s do it!

1) Download the GParted Live ISO Image: (the 0.19.1-4 iso here was the latest as of this writing):

cd ~/Downloads
curl -L -O http://downloads.sourceforge.net/gparted/gparted-live-0.19.1-4-i486.iso

2) Expand the Bitcraze VM Hard Drive:
a) Open the settings widow by choosing “Settings…” from the “Virtual Machine” menu.
b) Click “Hard Disk” in “Removable Devices” row.

c) Set the volume size to something bigger maybe 80GB (or 250GB or even 1TB if you want).

d) Click the disclosure triangle next to “Advanced options”
e) Check the box next to “Split into multiple files.”

f) Click the “Apply” button

g) After seeing “Virtual disk resized successfully” click “OK” (the disk maintenance tools they mention is something like GParted, which we will use).

h) Click the “Show All” button.

3) Select the GParted Live ISO as the Startup Disk:
a) Click “CD/DVD” in “Removable Devices” row.

b) Click the “Autodetect” pull-down menu.

c) Click “Choose a disk or disk image…” in the pull-down menu.

d) Choose the “gparted-live-0.19.1-4-i486.iso” you downloaded in Step 1 from “Downloads” directory.

e) Slide the switch to “On” next to “Enable CD/DVD Drive.”

f) Click the “Show All” button.
g) Click “Startup Disk” in the “Other” row.

h) Click the “CD/DVD” icon in the list of startup devices.

i) Click the “Restart…” button.

If all goes well, your VM should restart from the GParted Live ISO. From this point onward, the steps are them same regardless of what virtual machine manager you’re using. The following section deals with what to do in GParted.

4) Boot Up GParted:
a) Press return or just wait 30 seconds until GParted starts.

b) Press the ‘tab’ key then the ‘return’ key.


c) Press the ‘return’ key if you’re cool with English or select another language by entering its number and pressing the ‘return’ key.

d) Just press the ‘return’ key again. We’ll drop into X windows and likely it’ll go OK (fingers crossed).

e) Wait until GParted is running and check out all that unallocated space we’ve got available!!

5) Do the partition resize:
Ok. Here’s the problem. We’ve got unallocated space, but it’s kind of blocked by the “linux-swap” partition. That’s not good. This is a problem I’ve encountered before on single-disk linux installs and it’s pretty common. It’s certainly not limited to the Bitcraze 0.5 VM. We’ll need to move stuff around. The following steps explain how.
a) Select the light-blue colored “extended” partition in the list and right-click it, then choose “Resize/Move.”


b) Drag the black arrow on the right side as far as it will go to the right.

c) Click the “Resize/Move” button.

d) Click the “Apply” check mark icon on the toolbar at the top of the window. When you see the confirmation dialog, click “Apply.” When you see the dialog saying “All operations completed successfully,” you can click the “Close” button.



e) Select the light-brown (clay?) colored linux-swap partition in the list and right click it, then choose “Resize/Move.”


f) Click in the white portion surrounded by the brown border and drag it all to the way to the right.

g) Click the “Resize/Move” button.

h) You’ll see a warning about moving a partition but it’s safe to ignore. Simply click the “OK” button.

i) Click the “Apply” check mark icon on the toolbar at the top of the window. When you see the confirmation dialog, click “Apply.” When you see the dialog saying “All operations completed successfully,” you can click the “Close” button.



j) Select the light-blue colored “extended” partition from the list again and once more, right-click, then choose “Resize/Move.”


k) This time, drag the left black arrow all the way to the right.

l) Click the “Resize/Move” button.

m) Click the “Apply” check mark icon on the toolbar at the top of the window. When you see the confirmation dialog, click “Apply.” When you see the dialog saying “All operations completed successfully,” you can click the “Close” button.



n) Finally, select the ext4 file system (/dev/sda1) at the top of the list, right click, then choose “Resize/Move.”


o) Drag the black arrow on the right as far as it will go to the right.

p) Click the “Resize/Move” button.

q) Click the “Apply” check mark icon on the toolbar at the top of the window. When you see the confirmation dialog, click “Apply.” This time, the process will take a little longer and go through a few steps. When you finally see the dialog saying “All operations completed successfully,” you can click the “Close” button.





r) You’re done with the resize. You should have a new main drive with a bunch more space (or at least room enough to upgrade).

6) Quit GParted and Reboot Into Xubuntu:
a) From the “GParted” menu, select “Quit” and you’ll land back at the live CD desktop.


b) On the desktop, double-click the “Exit” icon.

c) Select “Shutdown” from the list in the dialog and click “OK.”

7) Switch the VM Startup Drive Back to the Main Hard Drive:
The following section again deals with VMWare as the virtual machine manager. If you’re using something else, this section won’t apply to you.
a) Open the settings widow by choosing “Settings…” from the “Virtual Machine” menu.
b) Click the “CD/DVD” icon in the “Removable Devices” row.

c) Click “gparted-live-0.19.1-4-i486.iso” pull-down menu.
d) Choose “Autodetect.”
e) Slide the switch to “Off” next to “Enable CD/DVD Drive”


f) Click “Show All”
g) Click the “Startup Disk” icon in the “Other” row.

h) Click the “Hard Disk” icon in the list of startup devices.

i) Click “Restart…” button.

That’s it. Now you’ve got some (or a lot) more room. Go ahead and upgrade your Xubuntu VM. Or just engineer the hell out of things and generate tomes of code! You’ve got plenty of room now.

Comments are closed.