Sei sulla pagina 1di 3

1. Make sure the following prerequisites are met: The virtual machine is powered off.

. The virtual disk is not mapped (on Windows guests) or mounted (on Linux Guests). You cannot expand a virtual disk while it is mapped or mounted. The virtual machine has no snapshots. The virtual machine is not a linked clone or the parent of a linked clone. To determine whether the virtual machine has snapshots, is a linked clone, or is the parent of a linked clone, check the information at the top of the Summary tab for the virtual machine. 2. Select VM > Settings. 3. On the Hardware tab, select Hard Disk for the virtual hard disk to expand. 4. Select Utilities > Expand. 5. Set the new maximum size for the virtual disk. 6. Select Expand. 7. Click OK after the disk expansion process is complete. 8. Download the Gparted iso. Gparted is a free disk management tool. You can use any of the available tools. 9. Mount the Iso on the VM that we have just expanded and power on the VM. Ensure that the VM boots from the Gparted iso. Gparted provides a friendly UI to do partition and disk operations. The expanded size would appear as un-partitioned space. Resize the existing volume to claim the expanded size. Apply the changes and reboot. 10. On Reboot, the disk would reflect the new size.

Edit Tips Using Command Line: o You can also increase the disk size using the following command line. But the same prerequisites apply. From the command prompt on the host: o C:\Program files\VMware\VMware Workstation> vmware-vdiskmanager.exe -x <Final size of the vmdk in GB> <path to my .vmdk> o e.g.: vmware-vdiskmanager.exe -x 36GB C:\myvms\myDisk.vmdk Once the above command is run, you have to repeat the same steps with Gparted to use the increased space. Alternate method to increase the disk space of any VM: An alternate method to increase the disk space of any VM is to use VMware Converter. The VMware converter is a free download and is used to convert physical machines to virtual machines (P2V) and also from one type of Virtual machine to another type (MS VPC VM to Vmw workstation VM). Follow the default steps on the converter. Select the VM and specify a new size for the disk. This is as good as creating a clone of the existing VM but with different configurations.

Edit Warnings Increasing the disk space of VM with snapshots and redo disks can be dangerous resulting in the corruption of VMs. So it is better to do a snapshot delete all operation to merge all the changes before trying to resize the disk. It is often advised to take a full backup of the VM before making any changes

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15.

16. 17. 18. 19. 20. 21. 22.

23.

Shutdown the VM Right click the VM and select Edit Settings Select the hard disk you would like to extend On the right side, make the provisioned size as large as you need it Click OK Power on the VM Connect to the command line of the Linux VM via the console or putty session Log in as root The fdisk command provides disk partitioning functions and using it with the -l switch lists information about your disk partitions. At the command prompt type fdisk -l The response should say something like Disk /dev/sda : xxGB. (See Figure A) At the command prompt type fdisk /dev/sda. (if dev/sda is what was returned after step 10 as shown in Figure A) Type p to print the partition table and press Enter (also shown in Figure A) Type n to add a new partition Type p again to make it a primary partition Now youll be prompted to pick the first cylinder which will most likely come at the end of your last partition (ex: /dev/sda3 ends at 2610). So I chose 2611 for my first cylinder, which is also listed as the default. If you want it to take up the rest of the space available (as allocated in step 4), just choose the default value for the last cylinder. Type w to save these changes Restart the VM Log back in as root At the command prompt type fdisk -l. Youll notice another partition is present. In Figure Bit is listed as sda4. You need to initialize this new partition as a physical volume so you can manipulate it later using the Logical Volume Manager (LVM). Now youll add the physical volume to the existing volume group using the vgextend command. First type df -h to find the name of the volume group. In Figure C, the name of the volume group is vg_root. Now type vgextend [volume group] /dev/sdaX. (ex: vgextend vg_root /dev/sda4) To find the amount of free space available on the physical volume type vgdisplay [volume group] | grep Free

24. Extend the logical volume by the amount of free space shown in the previous step by typinglvextend -L+[freespace]G /dev/volgroup/volume. (ex: lvextend -L+20G /dev/vg_root/lv_root) 25. You can finally expand the ext3 file system in the logical volume using the commandresize2fs /dev/volgroup/volume (ex: resize2fs /dev/vg_root/lv_root). 26. You can now run the df command to verify that you have more spacedf -h

Potrebbero piacerti anche