Extend ext3 filesystem for RH5 Virtual Machine running in vCluster

1) Add more disk space to RH VM by vSphere
    a. Power off the RH VM
    b. Click 'Edit Virtual Machine Setting' in the panel of vSphere
    c. 'Hardware -> Hard Disk 1 -> Increase the provisioned size' , only thin provisioned can be increased. For thick, we need add another disk to extend the space.
    d. Reboot the VM

2)  Create new partition for the newly added disk space
    a. "/sbin/fdisk -l" to verify the total disk space is increased
    b. Run "/sbin/fdisk /dev/sda" to create new partition.
         "n -> p -> enter -> enter -> t -> 8e -> w",  "enter" means accept the default (use all available space)
    c. "/sbin/fdisk -l" to verify the newly added partition

3) Extend the Volume Group
    a. "/usr/sbin/vgdisplay" to verify existing Volume Group
    b. "ls /dev/VolGroup00/" to check the existing logical volume in the Volume Group00
    c. Extend the VG:
        /usr/sbin/vgextend /dev/VolGroup00 /dev/sda3   # /dev/sda3 is new partition
    d. "/usr/sbin/vgdisplay" to verify the Volume Group's size is increased
    e. "ls /dev/VolGroup00/" to check if a new logical volume created for this VG

4) Extend the existing Logical volume
    a. Running the following command to extend the existing Logical Volume( will use the space from the new logical volume automatically)
        /usr/sbin/lvextend +L340G /dev/VolGroup00/LogVol00    # Extend LogVol00 by using space from new (LogVol01)
    b.

5) Extend the file system on top, unmount the fs if necessary
    a. "df -u" to check fs size and usage
    b. Run the following command to extend the existing fs to use the additional space
        /sbin/resize2fs /dev/mapper/VolGroup00-LogVol00
    c. "df -u" to verify the fs is increased


Reference
http://www.howtoforge.com/logical-volume-manager-how-can-i-extend-a-volume-group
http://www.redhat.com/magazine/009jul05/features/lvm2/
http://www.tldp.org/HOWTO/LVM-HOWTO/extendlv.html
http://www.brighthub.com/computing/linux/articles/48452.aspx
http://www.tldp.org/HOWTO/LVM-HOWTO/

你可能感兴趣的:(Extend ext3 filesystem for RH5 Virtual Machine running in vCluster)