Growing LVM: lvextend, xfs_growfs
Sign in to read this lesson
At 3 a.m. monitoring alerts — /data is 95% full. This is LVM's main advantage — growing a volume in a few minutes without stopping the service. In this lesson we learn to grow when the VG has free space, when it does not (by adding a new disk), and to grow the root file system.
What you will learn
lvextend -r -L +1G /dev/vgweb/lvdatagrows the LV and the file system together (-r= resizefs).- Without
-r:lvextend, thenxfs_growfs /datafor XFS,resize2fs /dev/...for ext4. - If the VG has no space: new disk →
pvcreate→vgextend vgweb /dev/sdc→lvextend. -L +1G(add 1G) differs from-L 3G(make the total 3G);-l +100%FREE— all remaining space.- XFS cannot shrink; shrinking ext4 needs an unmount and
lvreduce -r— never do it without a backup.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.