I installed my server using the default partition sizes recommended during installation. Over time, I realized that I used more space of other partitions than /home. After much searching around, this is what I did to get my server’s partition resized.
“WARNING! THE FOLLOWING STEPS MAY CAUSE DAMAGED TO YOUR PARTITION AND IRRECOVERABLE DATA LOSS. BACKUP YOUR FILES BEFORE CONTINUE. USE AT YOUR OWN RISK!”
- Boot CentOS into Rescue Mode using CentOS installation DVD.
- Unmount the partition you wish to reduce the size.
umount /dev/mapper/VolGroup-lv_home
- Sanity check on the drive
e2fsck -f /dev/mapper/VolGroup-lv_home
- Resize the partition
resize2fs /dev/mapper/VolGroup-lv_home 20G
- Reduce the VolGroup partition
lvreduce -L-400G /dev/mapper/VolGroup-lv_home
- Increase the root VolGroup partition
lvextend -L+400G /dev/mapper/VolGroup-lv_root
- Increase the partitions to occupy full remaining space
resize2fs /dev/mapper/VolGroup-lv_root
resize2fs /dev/mapper/VolGroup-lv_home
- reboot