resizing /root

General support questions
User avatar
jlehtone
Posts: 3335
Joined: 2007/12/11 08:17:33
Location: Finland

Re: resizing /root

Post by jlehtone » 2021/02/18 14:40:45

Your LV centos-root contains a filesystem that is mounted as '/'.
The size of that filesystem is 50GB.
That filesystem contains directory '/root'.
The '/root' is thus within that 50GB.

Do you really have several gigabytes within the home directory of the admin account?

What do you get (as root) with:

Code: Select all

du -xh -d 1 /

Zosso
Posts: 10
Joined: 2016/07/03 17:01:09

Re: resizing /root

Post by Zosso » 2021/02/18 14:59:31

TrevorH wrote:
2021/02/18 14:20:32
So, off the top of my head with no real error checking...

swapoff -a
lvremove /dev/mapper/centos-swap
lvcreate -n swap -L2G centos
mkswap -v1 /dev/mapper/centos-swap
swapon -a
# removes, resizes, re-adds swap as 2G not 32G
lvresize -L+30G -r /dev/mapper/centos-root
it looks like for the swap it's ok thank you very much
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home centos -wi-ao---- <1,74t
root centos -wi-ao---- 50,00g
swap centos -wi-ao---- 2,00g
Reboot and everything is perfect wow !!!
Last edited by Zosso on 2021/02/18 15:13:50, edited 1 time in total.

Zosso
Posts: 10
Joined: 2016/07/03 17:01:09

Re: resizing /root

Post by Zosso » 2021/02/18 15:07:51

jlehtone wrote:
2021/02/18 14:40:45
Your LV centos-root contains a filesystem that is mounted as '/'.
The size of that filesystem is 50GB.
That filesystem contains directory '/root'.
The '/root' is thus within that 50GB.

Do you really have several gigabytes within the home directory of the admin account?

What do you get (as root) with:

Code: Select all

du -xh -d 1 /
0 /boot
65M /etc
1,5G /root
7,4G /var
416M /tmp
16G /usr
0 /media
0 /mnt
12G /opt
0 /srv
37G /


I improved the situation a bit I did not see that I had a virtual machine mounted in / root I deleted it and I gained 10GB

thanks again

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

Re: resizing /root

Post by jlehtone » 2021/02/18 15:26:12

Yes, virtual machine images go by default under '/var' which is within '/'.
There are multiple ways to have images elsewhere, including the bind-mount technique.

You can look deeper into the big directories. For example:
du -xh -d 1 /var /opt
(Read what du options 'd', 'h', and 'x' do from man du )

The 1.5G seems quite a lot for home directory of user 'root'.

Zosso
Posts: 10
Joined: 2016/07/03 17:01:09

Re: resizing /root

Post by Zosso » 2021/02/18 15:33:35

4,6G /var/lib.................................I have to investigate !!!
3,8G /opt/Allegorithmic........ok
3,2G /opt/hfs18.0.499..........ok
2,7G /opt/resolve..................ok



thank you

Post Reply

Return to “CentOS 7 - General Support”