Avatar of bleggee
Flag for United States of America asked on

Disk Space management tools for Linux Server?

Can anyone suggest any SW tools/utilities/commands to help manage disk space, identify space hogs, etc for a Linux Server?
(If it matters, it is a web server, headless CentOs 7 LAMP)
LinuxApache Web Server

Avatar of undefined
Last Comment
Duncan Roe

8/22/2022 - Mon
John Tsioumpris

SInce you are headless you either go for a text based disk usage application like DUtree or if you have webmin then you can go to File Manager.and as you hover over the folder name you will get 3 vertical dots...click on them and in the last entry in the context menu you will see Properties -->Calculate Selected Size
EDIT 1 : Well this was a bit quirky...there is an old module for Webmin called Disk Usage ...install the 1.2 version and you should see it under Others...somehow this should be the END but the module by default only queries the /tmp folder when the issue is to get the whole disk...so if you look carefully you will see a faded cog for settings...hit it and change to / let it calculate/collect and that's all...all the info in a single click
EDIT 2: it's added in the side notification panel and you have a quick overiew or click to have the whole pictureClipboard01.jpg

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
David Favor

I'd add these 2x to noci's list too, which simply add the -h (human option) for faster reading of output.

df -h
df -hi

Open in new window

I also use pyha like this...

# shell startup file
alias lsfs='pydf -ha | grep -P /dev/md | grep -v /var/lib/lxd'

# lsfs
/dev/md4    1804G 1111G  601G 61.6 [####..] /                              
/dev/md4    1804G 1111G  601G 61.6 [####..] /david-favor

Open in new window

Duncan Roe

I use this script
#set -x
mount >$T
find . -mount -mindepth 1 -maxdepth 1 -type d |
  while read i
    grep -E -q "on $(readlink -f "$i") " $T || du -sx "$i"
  done | sort -n
rm $T

Open in new window

which I have named vss, as below
cat vss.out

Open in new window

The largest directories are at the bottom, so are left on the screen. Run it in /, then in the largest few identified directories. ls -lSr (sort by size) if you don't see big directories in the next level down.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck