I want to extend my logical volume mounted to /home:
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
xvda 202:0 0 125G 0 disk
├─xvda1 202:1 0 500M 0 part /boot
└─xvda2 202:2 0 74.5G 0 part
├─centos_jenslv05-root 253:0 0 48G 0 lvm /
├─centos_jenslv05-swap 253:1 0 3G 0 lvm [SWAP]
└─centos_jenslv05-home 253:2 0 23.5G 0 lvm /home
As you can see xvda has 125GB and xvda1 + xvda2 have only 75GB combined. The extra 50GB is what i want to add to centos_jenslv05-home logical volume.
PVS
pvs
PV VG Fmt Attr PSize PFree
/dev/xvda2 centos_jenslv05 lvm2 a-- 74.51g 0
VGS
vgs
VG #PV #LV #SN Attr VSize VFree
centos_jenslv05 1 3 0 wz--n- 74.51g 0
LVS
lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home centos_jenslv05 -wi-ao---- 23.45g
root centos_jenslv05 -wi-ao---- 48.04g
swap centos_jenslv05 -wi-ao---- 3.02g
So basically i need to extend the partition dev/xvda2, add it to the PV, add it to VG and then to LVM which is mounted to home.
However, i don't want to loose data on root lv (/), which is on the same partition as the home lv (/home). Is there a way to extend only one logical volume, without touching other lvs? If it's not possible and i need to delete the partition and then recreate it with added space, will backing up all the files on /root and /home be enough? Can i recreate parition, then recreate lvs and copy the files back to lvs and will it start the server as it was? Is it safe?
I know that extending logical volume without touching others is possible on Windows, but not sure if it's as handy on Linux. The system is Centos 7.