Skip to content

Instantly share code, notes, and snippets.

@techyboy
Forked from troyfontaine/readme.md
Last active December 6, 2020 01:34
Show Gist options
  • Select an option

  • Save techyboy/93b116d05ae910636611315ca7d3bccd to your computer and use it in GitHub Desktop.

Select an option

Save techyboy/93b116d05ae910636611315ca7d3bccd to your computer and use it in GitHub Desktop.
Resize root partition (or how to remove the default /home partition) on CentOS 7 online

Remove /home partition on CentOS 7 Online

This requires you to be able to ssh into the instance using the root user account and that no services be running as users out of /home.

The examples are from a default installation with no customation-you NEED to know what you're working with for partitions to not mess this up.

By default, CentOS 7 uses XFS for the file system and Logical Volume Manager (LVM), creating 3 partitions: /,/home and

Step 1 - Copy /home Contents

To backup the contents of /home, do the following:

mkdir /temp
cp -a /home /temp/

Once that is finished at your back at the prompt, you can proceed to step 2.

Step 2 - Unmount the /home directory

umount -fl /home

Step 3 - Remove the logical volume

lvremove /dev/cl/home

Step 4 - Resize the root partition

xfs_growfs /dev/mapper/cl-root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment