Operations 4 min read

How to Shrink /home and Expand Root on CentOS 7

This guide walks through diagnosing a busy /home mount, installing missing tools, safely unmounting, resizing the home partition, installing XFS utilities, and finally expanding the root filesystem on a CentOS 7 server.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Shrink /home and Expand Root on CentOS 7

The original log server had an ill‑designed partition layout: a large /home volume and an undersized root ( /) partition. The goal is to shrink /home to free space and then enlarge the root filesystem.

1. Diagnose the busy /home mount

Attempting to unmount fails:

umount /home
# umount: /home: target is busy.

Normally fuser -m /home or lsof would reveal the holding processes, but the fuser command is missing.

2. Install the missing utility

yum install psmisc

After installation, run: fuser -m /home # shows PIDs using /home Identify the offending PID (e.g., 11757) and terminate it: kill -9 11757 Now the mount can be released:

umount /home

3. Resize the /home partition

If the filesystem is ext4, use resize2fs: resize2fs -p /dev/mapper/centos-home 100G First confirm the filesystem type: cat /etc/fstab | grep centos-home When the entry shows xfs, install the XFS dump tool before resizing: yum install xfsdump -y After the appropriate tool is present, shrink the home volume to the desired size (e.g., 100 GB).

4. Expand the root ( / ) partition

With free space reclaimed from /home, extend the logical volume that backs the root filesystem and then grow the filesystem accordingly. (The original article includes screenshots of the LVM commands and the resulting size increase.)

5. Remount /home

Attempting to mount the resized home fails with a superblock error, indicating the filesystem must be recreated:

mount /home
# mount: /dev/mapper/centos-home: cannot read superblock

Therefore, before shrinking /home, back up its data, format the partition anew, and restore the data after the resize.

The article provides a series of screenshots illustrating each command and the resulting partition layout.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

System AdministrationPartitionFilesystemCentOSRoot ExpansionHome Directory
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.