Drives get full fast  how to manage them

Posted on 2006-04-06
Last Modified: 2013-12-15
My /usr and /var get full all the time. How canI tell what is filling up the drive and keep it under control?
what command can asl show files in a tirectory say like the top 10 largest files?

root@diamond [~]# df -ahk
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda5              1035660    496460    486592  51% /
none                         0         0         0   -  /proc
none                         0         0         0   -  /sys
none                         0         0         0   -  /dev/pts
/dev/hda1                77749     20299     53436  28% /boot
none                    516248         0    516248   0% /dev/shm
/dev/hda8            142394868  39061064  96100540  29% /home
/dev/hda7              1035660     33484    949568   4% /tmp
/dev/hda2              4127108   3259464    657996  84% /usr
/dev/hda3              4127108   2325544   1591916  60% /var
/dev/hdc1            158309288  56591452  93676104  38% /backup
none                         0         0         0   -  /proc/sys/fs/binfmt_misc
root@diamond [~]# w
 09:43:45 up 14 days,
Question by:jbrashear72
    LVL 87

    Accepted Solution

    /usr normally doesn't fill up without you installing software yourself.

    /var on the other hand has many things that can fill up. First look in the /var/log folder, you'll see log files allways getting larger. The easiest way to control these is to manage them with webmin. Webmin is a administration tool for linux you can use for many things, one of them is you can rotate log files (keep them at a manageable size, archive the older versions so they don't use as much space, and delete those that get too old).

    depending on what you are running on that PC, there are other folders inside /var that can fill up, mainly those in your cache folder.

    I usually use midnight commander to view details. You can set the sort order to sort by file size. Depending on your distro you might have it already installed. enter mc in a terminal window to find out...
    LVL 3

    Author Comment

    Not the answer i need..
    LVL 12

    Expert Comment

    /var keep lots of stuff as rindi said cache folder is one of it, also the /var/log will keep the system log, such as security, mail etc.... which depend on what application installed and how they handle the log files.

    /usr mainly maintain the system program and the applications, so if you install lots of applications which might fill up the /usr also if your application keep the log file in /usr/appication/log will also fill up the /usr

    so what's the size of the partition of /var and /usr ??

    can you post the df -h here.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    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…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 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