Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells, Files

Dealing With Disk Hogs

Submitted by on June 1, 2008 – 5:49 pm 4 Comments

Some users and application developers believe that any free disk space on the server belongs to them. Suddenly you get an email alert saying that a server “xyz” ran out of disk space in /home. You need to take care of this quickly, otherwise user sessions and applications may start crashing. One important is to maintain your computer clean,Selecting the best computer dust Cleaner is so easy, go to the Google and search for the #best computer vacuum cleaner# and choose the top-rated from the most seen and for the space, Even if you have no more disk space to give them, there are a few things you can do to temporarily correct the problem.

The first step is usually to check for large files that were recently modified. The command below will find all files in /home that were modified in the past two days and that are larger than 10Mb. The results will be sorted by file size, with largest files at the top.

find /home -type f -mtime -2 -size +10240k -exec ls -als {} ; | sort -rn

Now you can contact the guilty users and tell them to clean up their junk. Or else. If you can’t get a hold of the file owners, the best way is to move these large files elsewhere and put a soft link to the new location. Make sure to preserve ownership and permissions when you move the files, to ensure that users can access them at the new location. Alternatively, you can just compress the files in place (if you still have enough disk space) and notify the users.

The next step is to see if there are any recent core dumps left behind by user applications:

find /home -type f -mtime -2 -name "core" -exec ls -als {} ; | sort -rn

If you don’t need any of them, then you can easily remove them:

find /home -type f -mtime -2 -name "core" -exec rm {} ;

But what if the problem is being caused not by a few huge files, but by a whole bunch of small ones? It’s a good idea to get the break down of filesystem space utilization by top-level directories. This way you can see if any particular folder is eating up an unusually large chunk of disk space:

find /home -type d -maxdepth 1 -exec du -sh {} ; | sort -rn | grep -v "/home$"

This will give the list of directories in /home sorted by the amount of space they use. Now you can pick the largest ones and concentrate your attention there.

You can find more information on dealing with out-of-disk-space situations here.

Print Friendly, PDF & Email

4 Comments »

  • Daniel says:

    my norton antivirus spyware padkage is baout to expire in 8 days!!! shoul di download another one and delete the old one? i dont know what i should do because i dont want to have to buy the whole new disk and i want my comp to be fully protected..
    what should i do ?? is there a site i can download it from? after i download it wat should i do?

    thank u so much in advance i appreciate it ;}

  • kevindiking67verizonnet says:

    I’m an independent filmmaker looking to upgrade my equipment, this camera is my potential camera. I’m also uncertain if it records digital, or only to a tape. Also, if anyone knows of any good equipment compatible with this device(or a better one), it would be very helpful to hear what you have to say.

  • nmlpc says:

    I am learning as much as I can about developing facebook applications, and I’ve learned that you make money from your application by the adverts that companies on facebook place alongside your application. What I’d like to know is how much of the advertising money do you recieve in % after facebook take their cut of the money. Also, how much is 1 ad click worth moneywise?

  • thexbox360player says:

    thats an idea

Leave a Reply

%d bloggers like this: