Increase the Primary File Partition on Ubuntu running on VMPlayer
It should have been a simple few steps to achieve expanding the primary file partition on my Ubuntu VM , however that was not to be. Below are the steps that I executed to successfully increase the partition size. Looking at different sites I found that my VM refused to react the same way that was stated in all the available solutions. These little obstacles are explained below and the corresponding solution that resolved it.
- Download the GParted Live CD , you will need this tool to increase your disk size. Download the version that supports your VM, I used xxx-0.18.0-1-i486.iso version.
- Power off your VM, from the VM Player Menu.Select your Virtual Machine Settings and change the Connection to "Use ISO image" and browse to the freshly downloaded GParted ISO. This will effectively mount the image without having to burn it onto a CD.
- Select Hard Disk from the same screen and increase to the desired number.
- Reboot the guest OS. Quickly press F2 on the VMware preboot load screen to enter the virtual VMware BIOS. Go to the Boot tab and bring the CD-ROM drive to the top by scrolling to it and clicking + repeatedly. Now save and exit. The next time the OS tries to boot, it will first try to load the LiveCD. GParted should load after a few minutes where everything should be very straightforward.
- Well, it did not work that way for me. No matter what I did I could not boot off the live cd. I tried F2 and Esc multiple times to get into the BIOS menu, tried increasing the Boot Delay to 5000 in the .vmx file, tried some more F2 in super speed mode, but to no avail. I simply could not invoke the Gparted GUI from the live cd. You can execute it when the VM is up but then you cannot unmount your primary partition and therefore cannot resize it.
- I had to enable the grub menu so that while booting all my boot options are displayed. I did this by hashing out the #GRUB_HIDDEN_TIMEOUT="0"
option in the /etc/default/grub file. When in the grub menu screen, I selected "c", and then "exit" out of the grub command line.
- On exiting, the VM immediately boots off the Gparted iso ! Voila ! From now onwards it is pretty intuitive. Select your language and the default start mode, then the Gparted Live screen is active and you will be able to see your partitions. There are multiple images at the GParted Site that helps clarify the different options.
- But we are not done yet. My partitions were structured as in the image below (simple and usually the default). My primary partition seemed to be locked even though I had booted off the iso. Turns out that you cannot increase the Primary partition unless you SwapOff and delete your Swap/Extended partition. The option to "Resize" remained disabled for me until I deleted these partitions.
- Once the the Resize option is enabled for the primary partition, make the required changes and Apply them. You can redo and undo partitions as needed.
- Recreate an extended partition and then allocate as linux swap. Remember about SwapOn before you exit the tool. Here is a snapshot of my partitions after the changes.
Thought I would jot it down for future use ...
No comments:
Post a Comment