Solved

tricks and skills for managing linux disk space

Posted on 2014-03-01
9
501 Views
Last Modified: 2014-03-04
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
0
Comment
Question by:TIMFOX123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 29

Assisted Solution

by:serialband
serialband earned 250 total points
ID: 39898178
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
0
 
LVL 13

Expert Comment

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

TY/SA
0
 
LVL 62

Accepted Solution

by:
gheist earned 250 total points
ID: 39898799
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...
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 17

Expert Comment

by:Gerald Connolly
ID: 39899246
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
0
 

Author Closing Comment

by:TIMFOX123
ID: 39902272
Gerald, every place I have been lately pretty much lives on EMC & VMware.  Disk space goes for a lot of money.
0
 
LVL 17

Expert Comment

by:Gerald Connolly
ID: 39902291
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
0
 
LVL 62

Expert Comment

by:gheist
ID: 39903157
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.
0
 
LVL 29

Expert Comment

by:serialband
ID: 39905003
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.
0
 
LVL 17

Expert Comment

by:Gerald Connolly
ID: 39905695
OP said they were short of space, that just ups the ante when it comes to management time.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question