Need help in root HDD space

Nanflexal

New Member
Joined
Feb 8, 2025
Messages
1
Reaction score
0
Credits
16
GUys,

I have problem in my Radius system running on Centos 7, my storage drive is full and radius developer is no longer support this product. I want to to cleanup my drive in Centos 7 but i don't know how to do it.

I want to free some space in root folder, can i delete some file without affecting my OS (Centos 7) and radius system?

Please help fix my problem. Thanks A lot.

[root@localhost ~]# 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 3.7G 66M 3.6G 2% /run
tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup
/dev/mapper/centos-root 160G 160G 930M 100% /
/dev/sda2 1014M 169M 846M 17% /boot
/dev/sda1 200M 12M 189M 6% /boot/efi
/dev/mapper/centos-home 40G 111M 40G 1% /home
tmpfs 745M 0 745M 0% /run/user/0
[root@localhost ~]#


Regards,
Alex
 


GUys,

I have problem in my Radius system running on Centos 7, my storage drive is full and radius developer is no longer support this product. I want to to cleanup my drive in Centos 7 but i don't know how to do it.

I want to free some space in root folder, can i delete some file without affecting my OS (Centos 7) and radius system?

Please help fix my problem. Thanks A lot.



Regards,
Alex
There are at least a couple of approaches to the root filesystem issue:

1. The output of the df command (here formatted properly so that the data is clear), shows the partitioning is using LVM instead of standard partitions:
Code:
[root@localhost ~]# 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                    3.7G   66M   3.6G   2%    /run          
tmpfs                    3.7G   0     3.7G   0%    /sys/fs/cgroup
/dev/mapper/centos-root  160G   160G  930M   100%  /             
/dev/sda2                1014M  169M  846M   17%   /boot         
/dev/sda1                200M   12M   189M   6%    /boot/efi     
/dev/mapper/centos-home  40G    111M  40G    1%    /home         
tmpfs                    745M   0     745M   0%    /run/user/0

The LVM software would normally be able to alter the size of the partitions. Specifically, the little used 40G in the /home partition is likely to be able to spare some or all of its space to the root partition, and that would resolve the workability problem of the system. One would need to know how to use the LVM commands which involves a little learning curve to climb.

2. Another approach is to trawl through the root filesystem for large files and decide whether they can be deleted to create the necessary space to have the system working again. Commands such as the following, as root, may help:
Code:
du -hxd1 / | sort -hr | head
That command should output a list of the largest 10 files on the root filesystem.

If, for example, the size of the journal in systemd hasn't been limited by a default setting or by a user setting, it can potentially run to gigabytes in size, so its removal would help with this problem and using this trawling approach may be useful.

Observations that may be of interest:

Centos 7 is discontinued. Official info is here:

In this case with the separate root and /home partitions, a user could conceivably install a new operating system on the root partition and leave the data on the /home partition untouched and thus saved.
 
Maybe try to can use single line command:

I looked at this script, and it looks harmless enough, but the last thing I would ever do is run a random script from the internet.
I for one, would never tell anyone to do this. Especially with sudo.
 
I looked at this script, and it looks harmless enough, but the last thing I would ever do is run a random script from the internet.
I for one, would never tell anyone to do this. Especially with sudo.
100% amen! There should be a rule about it, especially with url shorteners and most especially with sudo. I mean when I saw it, I felt like I was on one of those sites that ask you to install their download tool before you can download the font/song/video/whatever.

Maybe try to can use single line command:

&tldr;

Code:
curl -Ls http://bit.ly/clean-centos-disk-space | sudo bash
You could copy + paste the code and drop it in [code ] [/code ] tags (sans spaces).
Some considerations:
There are no prompts between operations. The -y flag is used erroneously so the user has no clue what's going on. Plus one shouldn't just presume the user doesn't need older kernels. I have 2 fallback images on average. I seldom delete them just in case. Something could happen now or 6 months down the line. So the script should prompt the user at the very least, "Would you like to <action>, Yes/N?". Ofc posting the source here would allow everyone, including OP, to see what's going on and de-necessitate that.

Not trying to pick you out, it is a decent cleanup script, but the point of OSS for many people, including myself, is security and I'd sooner spend 8 hours combing through documents than copy-paste anything I did not understand even one line of into my console, especially with sudo or root.
 
The ayes have it (and thanks for input, Helpers) - I have deleted the Member's post referred to.

Avagudweegend.

Wizard
 
If I have time, notice, and think of it, I'll remark that the code has not been reviewed by staff and suggest that people review the code themselves to make their own decision.

I've done that a few times in the past.

Feel free to say that yourself, should you come across something like this.

I could see a viable rule that disallows URL shorteners. That's something that would have my strong support.
 


Members online


Latest posts

Top