Solved

tricks and skills for managing linux disk space

Posted on 2014-03-01
9
498 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
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 28

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 61

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
 
LVL 16

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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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 16

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 61

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 28

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 16

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

920 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now