How to increase size centos-home and reduce centos-root

General support questions
Post Reply
wayc0de
Posts: 1
Joined: 2021/01/27 06:26:41

How to increase size centos-home and reduce centos-root

Post by wayc0de » 2021/01/27 06:34:36

Hi All,

This is my first thread, I have a problem when trying to increase my centos-home because almost full.
I need to reduce my centos-root and then resizing my centos-home using unallocated space.

Code: Select all

# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 908M     0  908M   0% /dev
tmpfs                    919M  4.0K  919M   1% /dev/shm
tmpfs                    919M  8.7M  911M   1% /run
tmpfs                    919M     0  919M   0% /sys/fs/cgroup
/dev/mapper/centos-root   50G  3.7G   47G   8% /
/dev/sda1               1014M  318M  697M  32% /boot
/dev/mapper/centos-home   56G   43G   13G  79% /home
tmpfs                    184M     0  184M   0% /run/user/1000
tmpfs                    184M     0  184M   0% /run/user/
Is that possible? If you have references please send the link to this thread

Thanks

User avatar
TrevorH
Forum Moderator
Posts: 30344
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to increase size centos-home and reduce centos-root

Post by TrevorH » 2021/01/27 10:26:18

Run df -hT so that it shows you the filesystem type. If / is xfs then you cannot do this as xfs cannot be shrunk.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
jlehtone
Posts: 3349
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to increase size centos-home and reduce centos-root

Post by jlehtone » 2021/01/27 10:40:17

While xfs cannot shrink, it is possible to make a backup of the content, remove the root LV, create new LV for root and restore content to it. That obviously requires running a separate OS that does not require the disk. For example, the installer from USB in rescue mode.

Post Reply

Return to “CentOS 7 - General Support”