I did an server install of Centos 9 and let the installer do automatic partitioning and it set it up like this with a massive /home partition and a tiny / partition, how to I shrink the /home partition to expand the almost full / partition?
df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.7G 0 3.7G 0% /dev
tmpfs 3.7G 0 3.7G 0% /dev/shm
tmpfs 1.5G 166M 1.4G 12% /run
/dev/mapper/cs-root 70G 68G 2.9G 96% /
/dev/sda1 1014M 225M 790M 23% /boot
/dev/mapper/cs-home 857G 76G 781G 9% /home
tmpfs 751M 0 751M 0% /run/user/1000
lvs -a -o +devices
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices
home cs -wi-ao---- 856.82g /dev/sda2(943)
root cs -wi-ao---- 70.00g /dev/sda2(220290)
swap cs -wi-ao---- 3.68g /dev/sda2(0)
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 930.5G 0 part
├─cs-root 253:0 0 70G 0 lvm /
├─cs-swap 253:1 0 3.7G 0 lvm [SWAP]
└─cs-home 253:2 0 856.8G 0 lvm /home
sr0 11:0 1 1024M 0 rom
Repartitioning
Re: Repartitioning
Since the default filesystem is xfs and that cannot be shrunk you will need to back up the data, umount /home, lvresize it, reformat it, remount it and then restore the data.
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Re: Repartitioning
Why your '/' is full? What consumes the space?
Applications should not take that much ... except perhaps some really big commercial packages (games?).
If you do have data, like database, website, containers, etc, their subdirectories could be mounted from
other filesystems. Such division makes also reinstall easier.
Applications should not take that much ... except perhaps some really big commercial packages (games?).
If you do have data, like database, website, containers, etc, their subdirectories could be mounted from
other filesystems. Such division makes also reinstall easier.
Re: Repartitioning
Master server backups, probably easiest to move /huntingdon-backup to /home/huntingdon-backup
du -h / --max-depth 1
186M /boot
0 /dev
70G /home
0 /proc
149M /run
0 /sys
4.0K /tmp
21M /etc
76K /root
12G /var
1.4G /usr
0 /afs
0 /media
0 /mnt
0 /opt
0 /srv
54G /huntingdon-backup
462M /home-potassium
0 /nsa320s-backup
Re: Repartitioning
Indeed.
Personally, I do like bind-mounts as means to hide where data really is - no need to tamper service config or selinux. Then again /home has its own selinux rules. Not that any of that matters with that backup.
PS. The du has flags, like -x, to not look at "other" filesystems.
Personally, I do like bind-mounts as means to hide where data really is - no need to tamper service config or selinux. Then again /home has its own selinux rules. Not that any of that matters with that backup.
PS. The du has flags, like -x, to not look at "other" filesystems.