We moved this page to our Documentation Portal. You can find the latest updates here. |
Issue
After CentOS installation, logical volumes are used instead of partitions in the default disk layout. Also, the root (/) volume is smaller than expected as the majority of the capacity has been allocated to the home (/home) volume.
Environment
Servers with a local CentOS installation
ext4 filesystem
Resolution
Run the following commands to resize the two volumes without reinstalling the OS:
lvresize --resizefs --size -[amount of not needed capacity] [home volume path]
lvresize --resizefs --size +[amount of needed capacity] [root volume path]
For example, if you need to reallocate 100GB from vg_cp01-lv_home to vg_cp01-lv_root, the commands would look as follows:
lvresize --resizefs --size -100GB /dev/mapper/vg_cp01-lv_home
lvresize --resizefs --size +100GB /dev/mapper/vg_cp01-lv_root