Skip to content

Instantly share code, notes, and snippets.

@kokkytos
Last active September 2, 2023 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kokkytos/3d5d99a6564e5a26b08413e8621c8be5 to your computer and use it in GitHub Desktop.
Save kokkytos/3d5d99a6564e5a26b08413e8621c8be5 to your computer and use it in GitHub Desktop.
[shrink home, extend root] #LVM
  1. Shrink /home partition to 800GB, (system will force you to check filesystem for errors by running e2fsck)
e2fsck -f /dev/mapper/gisbox--vg-home
resize2fs /dev/mapper/gisbox--vg-home 800G
  1. Reduce the LVM to 800G
lvreduce -L 800G /dev/mapper/gisbox--vg-home
  1. Extend /root LVM to new size, utilizing 100% of free space on disk or +2GB
#lvextend -l +100%FREE /dev/mapper/gisbox--vg-root
lvextend -L +72G /dev/mapper/gisbox--vg-root
  1. Grow /root partition to new LVM size
resize2fs /dev/mapper/gisbox--vg-root

Sources

https://pingtool.org/online-resize-lvm-partitions-shrink-home-extend-root/

https://www.linuxtechi.com/extend-lvm-partitions/

https://www.thegeekdiary.com/centos-rhel-how-to-shrink-lvm-root-file-system/

https://www.frakkingsweet.com/mounting-an-lvm-volume-in-debian-live-cd/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment