Logical volumes can be dynamically stretched online. To expand the space of a logical volume, you do not need to detach the file system. To stretch a logical volume, follow these steps: ensure that there is sufficient free space in the volume group: vgdisplay expands the specified logical volume space: lvextend-L + 10G/dev/linuxcast-vg/mylv Update file system: resize2fs/dev/linuxcast-vg/mylv view the updated file system: df-h
Stretch a volume group: www.2cto.com format the disk to be added to the volume group as a physical volume: pvcreate/dev/sdc Add the disk to the specified volume group: vgextend linuxcast-vg/dev/sdc view the Expanded size: The vgdisplay logical volume can be dynamically reduced. However, to scale down the logical volume offline, that is, detach it. Follow these steps to narrow down the logical volume:
Unmount the logical volume: umount/dev/lnuxcast-lv/mylv zoom out file system: resize2fs/dev/linuxcast-lv/mylv 10G zoom out logical volume size: lvreduce-L-5G/dev/linuxcast-lv/mylv after viewing the reduced size: lvdisplay mount: mount/dev/linuxcast-lv/mylv/mnt to narrow down a volume group: www.2cto.com remove a disk from a volume group: vgreduce linuxcast-lv/dev/sdc