tricks and skills for managing linux disk space

TIMFOX123
TIMFOX123 used Ask the Experts™
on
I am not looking for one answer, I am looking for knowledge to perform the task if managing disk space for Linux .

Pretty much  our disk space is managed with little spare space anywhere.

I would like to know:
1) what files are new ( with in the last month, 2 months etc ) on a partition such as /app
2)  how to find the disk space taken up by each directory.  Here is the catch, usually the disk space reported includes the subdirectorys.  An empty directory can report any size depending on what the subdirectories are and I only want to know want to know the disk space taken up only by the files in that directory.
3)  what kinds of files can normally be deleted in Linux. I already know old rpm files are kept in an directory.
4) Other secrets of the disk management game :)

thx

timfox123
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
1)
Find files modified in the last 30 days.
find . -mtime -30
Find files modified in the last 60 days.
find . -mtime -60

2)  Not sure what you mean exactly.  Empty directories report 0 for size with du.
du -sh *

3)  Old log files.

4)  Don't ever let linux disks get full.  Use du and df to monitor your system.  Remove packages that you don't need.  Assuming you use redhat, centos or a variant that uses yum.
yum remove PACKAGE.
yum clean

Commented:
Configure any monitoring agent which can give you alerts for protectiveness. I have all the similar answers as suggested by  TIMFOX123

TY/SA
Top Expert 2015
Commented:
There are no secrets:
1) logs should always be managed automatically (rotated etc)
2) Your scripts should not keep deleted files open ("unhide" tells you)

cd /
du -sk * | sort -n
cd fattest
repeat

and you slowli find the 2 years of protocol dumps or similar goldmines...
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

With the cost of disks being so low at present it will probably be more cost effective (taking all this management time into account) to upgrade to bigger disks/add more storage to system etc etc

Author

Commented:
Gerald, every place I have been lately pretty much lives on EMC & VMware.  Disk space goes for a lot of money.
Well you just have to cost your time against the cost of a disk, it doesnt take very long to afford another 10TB of disk, if that reduces your management workload by 50% then the pay-back time is going to measured in weeks
Top Expert 2015

Commented:
Having 10TB of space does not free you from maintaining logs and other system housekeeping tasks.... OK, you have long way to fill the disk, but sooner or later it will be full if unmaintained.
Also, Employee salary is already budgeted.  New hardware purchases may not be.  The "boss" may not want to spend the money if it will make you sit around and twiddle your thumbs even more.  Unless, there's an urgent project need, I find that the finance guys hate buying stuff, since that messes with their spreadsheet balances.
OP said they were short of space, that just ups the ante when it comes to management time.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial