High Performance Starts Here — AMD Dedicated Servers

English

Home

Blog

How To Extend Root Partition using Home ...

How To Extend Root Partition using Home Partition space in CentOS

How To Extend Root Partition using Home Partition space in CentOS

NetShop ISP

NetShop ISP · Blog Author

May 30, 2024 · Technical Tutorials

After popular demand by existing customers using CentOS 7 servers, we have prepared this tutorial on how to resize root partition after deleting the default /home partition.

In graphical installation of CentOS 7, unless specified otherwise, the installer will create the following partitions: /centos-root , /centos-home and /swap.

This happens usually when system admins forget to customize the partitioning layout during the installation process. There is a solution though which does not require you to re-install the server.

Steps to Resize Root Partition in CentOS and Deleting Home Partition

Pre-requisites:

  • SSH Access on CentOS 7 Server with root or sudo privileged user
  • XFS Filesystem with LVM
  • Ensure you have taken all necessary backups – any disk related operations are high risk!

Step 1: Copy contents of /home directory

Regardless if you already took backup of your entire server, do another quick backup of the /home directory in a location within the server. After the completion of the resize operation, you will be able to quickly transfer back the contents to the /home directory.

root@localhost:~$ mkdir /temp && cp -a /home /temp/

Step 2: Unmount /home

The following command will unmount /home directory. This is a crucial step as without unmounting you cannot proceed to the next steps.

root@localhost:~$ umount -fl /home

Once done, execute the lvs command to display the attributes of the LVM volumes (you will need these in Step 3).

root@localhost:~$ lvs

Step 3: Remove the Home LVM Volume

Run the following command to remove the LVM volume for home.

root@localhost:~$ lvremove /dev/centos/home

Important: We used …/centos/… because of the “VG” attribute from Step 2. If yours is different please adjust your command in Step 3 accordingly.

Step 4: Resize/Extend the Root LVM Volume

From Step 2, we see (in our example) that the LSize of home volume is ~2,13T. Therefore, it is safe to extend our root LVM by 2 TB.

root@localhost:~$ lvextend -L+2T /dev/centos/root

Then run the following command to finalize the resizing of root partition:

root@localhost:~$ xfs_growfs /dev/mapper/centos-root

Step 5: Copy contents of /home back to original directory

root@localhost:~$ cp -a /temp/home /

Confirm that you see all of your directories and files in /home by executing the command ls /home/.

If you are happy with what you see, proceed and delete the temporary directory you created in Step 1 as follows:

root@localhost:~$ rm -rf /temp

Step 6: Update /etc/fstab and Sync systemd with all changes

At this point we have resized the root partition successfully but we need to ensure that the system will not look to mount the /home partition on its next boot. For this reason you need to remove the line for /dev/mapper/centos-home from file /etc/fstab. Do so using your favorite editor (nano, vi, etc).

Finally, run the following command to sync systems with all changes above.

root@localhost:~$ dracut --regenerate-all --force

You are all set! Enjoy your newly resized Root partition in CentOS!

centos
how to
linux
tutorials
Press Releases
97

Free VPS Trial

No Credit Card Required.

Start Your VPS Hosting Free Trial

Recent Posts

Hermes AI Agent VPS - Deploy in 1 Click

Introducing Hermes Agent VPS: Your Own AI Agent, Live in One Click

22 July 2026

How To Protect Your Website from DDoS Attacks in 2026

How To Protect Your Website from DDoS Attacks in 2026

14 July 2026

Why Your Stream Keeps Buffering (And How to Fix It)

Why Your Stream Keeps Buffering (And How to Fix It)

08 July 2026

How to Secure Your WordPress Website in 2026

How to Secure Your WordPress Website in 2026

30 June 2026

How To Fix Outdated Theme on cPanel / WHM

Why Your cPanel or WHM Login Page Is Showing an Outdated Theme (And How to Fix It)

22 June 2026