1. Add hard disk space, name and size customization for VM.
2. Log in to the console and determine the mount point to be expanded.
[root@el5enhance16 ~]# df
Filesystem 1K-???? ??? ??????? ???????
?dev/mapper/VolGroup00-LogVol00
24218752 21835704 1132952 96% /
/dev/xvda1 101086 13369 82498 14%
/boot tmpfs 1048664 0 1048664 0% /dev/shm
3. Confirm the partition mode of the hard disk, make sure to use the LVM partition method, and you can see the hard disk /dev/xvdb we just added
[root@el5enhance16 ~]# fdisk -l
Disk /dev/xvdd: 258 MB, 258160640 bytes
255 heads, 63 sectors/track, 31 cylinders
Units = ???????of 16065 * 512 = 8225280 bytes
??????? /dev/xvdd ?????????????????????
?isk /dev/xvda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = ???????of 16065 * 512 = 8225280 bytes
?????? Boot Start End Blocks Id System
/dev/xvda1 * 1 13 104391 83 Linux
/dev/xvda2 14 3263 26105625 8e Linux LVM
Disk /dev/xvdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = ???????of 16065 * 512 = 8225280 bytes
??????? /dev/xvdb ?????????????????????
4. Add PV
root@el5enhance16 ~]# pvcreate /dev/xvdb
Physical volume "/dev/xvdb" successfully created
5. Check the PV just added
[root@el5enhance16 ~]# pvdisplay
6. The following is to add the newly added physical volume to the existing logical volume group
[root@el5enhance16 ~]# vgextend /dev/VolGroup00 /dev/xvdb
Volume group "VolGroup00" successfully extended
7. View the space of the volume group
[root@el5enhance16 ~]# vgdisplay
8. Check the partition to determine the partition to be expanded
[root@el5enhance16 ~]# lvdisplay
9. Start the expansion operation
[root@el5enhance16 ~]# lvextend -L +9G /dev/VolGroup00/LogVol00
Extending logical volume LogVol00 to 32.84 GB
Logical volume LogVol00 successfully resized
10. Make the increased capacity effective
[root@el5enhance16 ~]# resize2fs /dev/VolGroup00/LogVol00
11. Finally, use df to see the current space situation
[root@el5enhance16 ~]# df