1. LVM resizing steps
- Create a partition
- Create PV
- Resize VG
- Resize LV
- Load size
Ii. Create a partition
Use a partitioning tool (such as fdisk) to create LVM partitions, but identify the partitions as 8E of the LVM partition type.
1 [[email protected] ~]# fdisk -l 2 …… 3 Device Boot Start End Blocks Id System 4 /dev/sdb7 4202496 6299647 1048576 8e Linux LVM 5 /dev/sdb8 6301696 8398847 1048576 8e Linux LVM
Note: We recommend that you execute partprobe once.
3. Create a PV
1 [[email protected] ~] # Pvcreate/dev/sdb7 # convert the required partition to PV partition 2 physical volume "/dev/sdb7" successfully created 3 [email protected] ~] # Pvcreate/dev/sdb8 # convert the required partition to PV partition 4 physical volume "/dev/sdb8" successfully created
Iv. Resizing VG
1 [[email protected] ~] # Vgextend vg01/dev/sdb8/dev/sdb9 # Add the newly created PV to the existing VG 2 volume group "vg01" successfully extended
5. lv resizing
Note:
1. The premise for LV resizing is that there is sufficient capacity in VG.
2. lv and filesystem can be resized online, but cannot be scaled online.
1 [[email protected] ~] # Lvextend-L 2G-N/dev/vg01/lv01 2 # resize lv01 from vg01 to 2G instead of 2G.
Six Heavy Loads
1 [[email protected] ~] # Xfs_growfs/dev/vg01/lv01 # This is the heavy load size of XFS partition Format 2 [email protected] ~] # Resize2fs/dev/vg01/lv02 # This is the heavy load size of ext partition format
Note: The XFS file system can only be resized and cannot be resized.
003. LVM resizing