Link to home
Start Free TrialLog in
Avatar of bleggee
bleggeeFlag 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)
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

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 pictureUser generated image
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

I use this script
#!/bin/sh
#set -x
T=$(mktemp)
mount >$T
find . -mount -mindepth 1 -maxdepth 1 -type d |
  while read i
  do
    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
vss>vss.out
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.