The steps below is taken from : Extending partitions on Linux VMware virtual machines | TechRepublic . To view the pictures mentioned in the step, please go to the site, i have modified the step from that site, as some steps were not clearly explained and missing:
- 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
- Type: 3 (partition number)
- Type: t (type)
- Type the default numbers you see on the line. in other words select default first available cylinder to the default last cylinder. In Figure A the default last is 2610 so you type 2611 in that case.
- Type 3 (partition Number)
- Type: 8e (set type to LVM)
- Type w to save these changes
- reboot
- Log back in as root
- At the command prompt type fdisk -l. You’ll notice another partition is present. In Figure B it is listed as sdaX.
- Type: pvcreate /dev/sdaX (where X i the number you see on step 23. to initialize this new partition as a physical volume s
- Now you’ll 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 (for me it was: . Now type vgextend [volume group] /dev/sdaX. (ex: vgextend vg_root /dev/sda4). in my case it was something like: vgextend VolGroup00 /dev/sda3
- Type: lvextend -l +100%FREE /dev/VolGroup00/LogVol00 to Extend the logical volume
- Type: resize2fs -p /dev/mapper/VolGroup00-LogVol00 to expand the ext3 file system in the logical volume
- You can now run the df command to verify that you have more space–df -h
Thats all
Ref:
http://www.techrepublic.com/blog/smbit/extending-partitions-on-linux-vmware-virtual-machines/286