Solved

tricks and skills for managing linux disk space

Posted on 2014-03-01
9
495 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 27

Assisted Solution

by:serialband
serialband earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Closing Comment

by:TIMFOX123
Comment Utility
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
Comment Utility
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
Comment Utility
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 27

Expert Comment

by:serialband
Comment Utility
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
Comment Utility
OP said they were short of space, that just ups the ante when it comes to management time.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

11 Experts available now in Live!

Get 1:1 Help Now