4-2 Extend Existing Logical Volumes Flashcards
after making partition
[root@localhost]# pvcreate /dev/newdisk
[root@localhost]# vgextend vg-name /dev/newdisk
[root@localhost]# vgdisplay
Extend a volume group with a new disk
[root@localhost]# lvextend -L 5G /dev/vg-name/lvmname lvdisplay df -h xfs_growfs /mnt/newdirxfs df -h
Extend the LVM to be exactly 5G in size
lvextend -L +5G /dev/vg-name/lvmname
Use the -l (lowercase L) option instead to use physical extents as the unit of measurements, use plus sign before number to add it or without to set it as total extents
lvdisplay
df -h
xfs_growfs /mnt/newdirxfs Or resize2fs /mnt/newdirext Or resize2fs /mnt/newdirext4
df -h
Extend the LVM and add an additional 5G
after adding another disk to same vg thats equal in size for data to fit, so the data on there has space to move to.
pvmove /dev/olddisk
vgreduce vg-name /dev/olddisk
vgdisplay
‘VG Size’ should be that much smaller
Move physical extents off of device to a different device in same volume group
lvextend -l +50%FREE /dev/vg-name/lvmname
lvdisplay
df -h
xfs_growfs /mnt/newdirxfs Or resize2fs /mnt/newdirext Or resize2fs /mnt/newdirext4
df -h
Increase by 50% of free space of volume