The capacity of virtual machines on EC2 is full. When we look at the LVM format, we suddenly think that we can use LVM for online resizing.
The create volume and attach disk of EC2 will not be mentioned. The following operations are performed on guestos,
Ls/dev/SD *# View the physical disk and find the Newly Added Disk fdisk/Dev/SDI # partition, in fact, can not be partitioned, because the previous PV is partitioned .. Pvdisplay # view pvpvcreate/Dev/SDI # Add to PV pvdisplay # view the added pvvgdisplay # view VG, find the vgvgextend volgroup you want to resize/Dev/Sdi1 # expand vgvgdisplay # You can see that the VG is increased. There is a free option below to check the number of idle pelvextend instances.-L +5118/Dev/mapper/volgroup-Lv_root # increase LV, and 5118 is the free number above resize2fs-F/dev/mapper/VolGroup-lv_root # kernel adjustment, wait for the end
Online LVM resizing