Resizing a partition in ESX server

July 19, 2011 • Customer Services       
Synopsis

Resizing a partition in ESX server

Article

One of the problems that you may encounter if using a virtual machine is running out of disk space. It’s a simple enough task to change the disk allocation, however getting the linux OS that censornet runs on to recognise the change can be a little fraught. To that end, we’ve prepared this guide to assist you in making the changes you need.

NB. It is vital that you back up the censornet virtual machine before starting this process. To do so, shut down the VM then from the file menu in the vmware infrastructure client, select “Export” then “Virtual Appliance”. This will allow you to restore the original censornet setup should this fail to work

You should also note that you will need at least 400MB of free space on the censornet virtual machine hard drive. If you have run out of space altogether, please contact support.

You will also need to download the “Ultimate Boot CD version 5”. Please download this from here:

Ultimate Boot CD

The first thing you need to do is to edit the settings on the virtual machine.

First, you need to increase the size of the drive to whatever size you need. We recommend that you increase it by at least 4GB, preferably 8GB.

You will also need to boot into the virtual machine bios. To enable that, click on the “Options” tab, then select “Boot options” and tick the box that forces the bios setup.

Exit the properties editor and open a console for the virtual machine. Now boot the machine. The virtual machine bios will now open. Using your arrow keys, navigate to the “Boot” menu. Make sure that the CDROM is higher in the list than the hard drive. Use the “+” and “-“ keys to set up the boot order thus:

Now we need to make sure that it boots from the “Ultimate Boot CD” image that you’ve downloaded. To enable this, click on the button at the top for “Connect CD/DVD”. Choose “Connect to ISO image” and browse to where you saved the iso. Click open, and the next time the virtual machine boots, it will boot from this image.

Ok, now press “F10” to save and exit the bios. The virtual machine will now reboot. When you get to the boot prompt, press “Enter”. This will then bring up the boot menu.

Choose the “Parted Magic” option using your arrow keys.

This will in turn open another screen asking you which boot options you want. Choose the default (option 1).

Essentially, this will then boot into a cut-down linux gui. Contained therein are a number of tools for disk management and system/network management and testing. We only want to run the GParted partition editor. Click on the icon on the desktop to open this.

This will now open a screen showing how the disk is currently partitioned. The swap partition is in a logical partition at the end of the old partition. This needs to be moved to the end of the unallocated space, so the extra space can then be added to the primary partition.

Unfortunately, this is more complicated than it sounds. There are several steps.

First, you need to extend the size of the Logical partition to fill all of the unallocated space. Do this by highlighting the “extended” partition in the list, then click “Resize/Move”.

Then in the next screen, using your mouse drag the end of the partition to the right hand side of the screen thus:

Then click the “Resize/Move” button. Once you’ve done this, highlight the “Swap” partition in the list, and once again click “Resize/Move”. Now using the mouse, drag the partition from the left side of the screen to the right, and again click the “Resize/Move” button. NOTE! You aren't resizing the partition, you are moving it. Click and drag the middle, not the edges.

Next, we need to move the start point of the logical partition so it is now at the end of the disk. To do that, highlight the “Extended” partition in the list, click “Resize/Move” and grab the left hand side of the partition. Drag this over to the right as far as it will go and click “Resize/Move”.

Once this is done, you should now have the unallocated space sitting next to the existing primary partition. We now need to resize this to use all that space. Highlight the primary partition, click “resize/move” again, and drag the right hand side of the partition as far to the right in the unallocated space as it will go. Then click “resize/move” again.

Once this is done, we are now ready to apply these changes. Click on the apply button, and wait for it to complete all of the tasks.

Once this is completed, you will be presented with a report on the operations. In most cases you will see “4 Warnings”. This is normal so don’t be unduly concerned.

Once the virtual machine has booted, check your disk and memory using the commands “df –m” and “free –m”.

Your censornet server should now be running with plenty of space available.

Related articles


Last modified on Tue, July 19, 2011 « Back