Skip to content

Instantly share code, notes, and snippets.

@szymonlopaciuk
Created March 7, 2018 07:52
Show Gist options
  • Save szymonlopaciuk/88866b202e74c886ecf62fe5bc34ac19 to your computer and use it in GitHub Desktop.
Save szymonlopaciuk/88866b202e74c886ecf62fe5bc34ac19 to your computer and use it in GitHub Desktop.
LVM: shrink one volume for another
# Unmount /home
umount /home
# Shrink the /home filesystem
fsck -f /dev/mapper/fedora-hmoe
resize2fs /dev/mapper/fedora-home 100G
# Shrink the /home logical volume
lvreduce -L -40G /dev/mapper/fedora-home
# Resize the /home partition to the size of the LV
resize2fs /dev/mapper/fedora-home
# Extend the /root logical volume
lvextend -L +40G /dev/mapper/fedora-root
# Extend the /root filesystem
fsck -f /dev/mapper/fedora-root
resize2fs /dev/mapper/fedora-root
# Mount /home
mount /home
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment