There seems to be an easier way now as lvresize
has a parameter --resizefs
that can do everything in one go now. See this gist
I’ve been in the situation where either root or home partition have been low on free disk space, while the other partition had lots of free space available. Therefore the idea is to first shrink the space on the partition where space is available and then give that space to the other partition. With that said, I’ve done this a couple of times already and the filesystems were healthy afterwards.
Initial situation:
What you need:
Note: In the bash commands that follow I resize the home partition to 40GB, you should adjust the disk space to something reasonable that fits your need.
How to resize partitions:
Disks
sudo su -
e2fsck -f /dev/mapper/fedora_localhost--live-home
e2fsck -f /dev/mapper/fedora_localhost--live-root
resize2fs /dev/mapper/fedora_localhost--live-home 40G
lvreduce -L 40G /dev/mapper/fedora_localhost--live-home
lvextend -l +100%FREE /dev/mapper/fedora_localhost--live-root
resize2fs /dev/mapper/fedora_localhost--live-root