Off the virtual machine, click the virtual machine, and then set up (directly modify the hard disk size, note that if there is a snapshot, you must first delete a snapshot, can expansion)
After the expansion, once again view the amount of disk space
fdisk -l
Add District
1: fdisk / dev / sda
2: Judging from our increased partition number should be 3 (dev / sda1, dev / sda2 ...... next should be dev / sda3, right)
Type n, add a partition to give:
3: Type p, primary partition, and type 3 (number):
Because the first two partition starts from 20480, the end of the hard disk 51200
4: The default can start sector and the end sector (two type Enter) Type t, modify the partition type 8E:
5: Type w, write the partition table, and then reboot:
Initializing the partition, the volume group added
1: the volume expansion, the group added to the LVM
pvcreate / dev sda3 initialization just partition /
2: Check the volume group and add the initialization of the virtual partition to the volume group
Vg_root new volume group is added to increase the capacity of the physical volume group of volumes sda3
vgextend volgroup / dev / sda3
Expand the size of the logical volume
1: Now you can extend the logical volume size
lvextend -L +20G /dev/mapper/VolGroup-lv_root
2: Use resizefs2 last command to reload the logical volume size to take effect
resize2fs /dev/mapper/VolGroup-lv_root
3: Then again see the size of the logical volume