source: http://www.virtualdojo.net/resize-rootpartition-on-ubuntu-v9-10-workstation/
The Virtual Machine (VM) templates I created for each Operating System (OS) were made with the smallest possible Virtual Hard Drives to conserve space. When I deploy one of these VM templates I almost always run into disk space problems. This is an easy situation to deal with in both the Windows and Linux OS.
Default partitioning with Ubuntu v9.10 will create a primary EXT4 partition for the root file system, and a small extended partition with a linux-swap partition. Partitions must be unmounted and the last partition on the disk in order to resize them. Since you cannot unmount the root partition once you booted from it, you must boot a CD to accomplish this task.
Mount the Ubuntu v9.10 Workstation ISO on the VM and boot. Press the [ESC] key quickly to get the VMware boot menu. Select the “CD-ROM Drive” option and press the [ENTER] key. Select your language then use the “Try Ubuntu without any change to your computer” option to boot the Ubuntu OS completely from CD.
Once you are at the desktop, start the partition editor by clicking “System > Administration > GPartEd” from the top navigation bar of the desktop. We will make all changes to the partition table using the GPartEd utility.
It is highly recommended that you clone or backup the VM before manipulating the partition table. While the potential to lose data exists, you can relax a bit since changes to the partition table will not be made until you click the “Edit > Apply All Operations” option from the GPartEd menu.
We must first turn off Swap and then delete the Swap partition and the Extended partion that it resides in before we can resize the root partition.
Turn off the Swap partition by clicking “Partition > Swap Off” from the GPartEd menu.
Delete the Swap partition by selecting it from the partition list and then clicking “Partition > Delete” from the GPartEd menu. The swap partition does not contain any valuable data and does not need to be backed up.
Delete the Extended partition by selecting it from the partition list and then clicking “Partition > Delete” from the GPartEd menu.
Resize the Root partition by selecting it from the partition list and then clicking “Partition Resize/Move” from the GPartEd menu. Drag the top slider all the way to the right to use all unallocated space. Then type in the amount of space you want to leave to recreate the swap partition into the “Free Space Following (MiB)” field. Be sure that the “Free Space Preceding (MiB)” value is set to “0″. Click the [Resize/Move] button to accept the changes.
Create a new Extended partition by selecting “Unallocated” from the partition list, then click “Partition > New” from the GPartEd menu. Drag the top slider all the way to the right to use the remainder of your unallocated space. Change the “Create As” type to “Extended Partition” (File System will automatically be set to “Extended”) and click the [Add] button to create the new partition.
Create a new Swap partition by selecting “Unallocated” under your “Extended” partition from the partition list and then clicking “Partition > New” from the GPartEd menu. Drag the top slider all the way to the right to use the entire Extended partition for your Swap. Change the “Create As” type to “Logical Partition” and change the “File System” type to “Linux-Swap” then click the [Add] button to create the new partition.
Save changes to the partition table by selecting “Edit > Apply All Operations” from the GPartEd menu. Click the [Apply] button on the confirmation dialog popup to begin applying the changes. Wait a few minutes while the changes are made on the hard drive then shutdown the VM.
Modify the VM settings to unmount the Ubuntu v9.10 Workstation CD then boot the VM. Check your partition table using the GPartEd utility to verify the changes were made then begin consuming your newly allocated storage!
No comments:
Post a Comment