is there a substatute for df -k ?

Posted on 2011-05-02
Last Modified: 2012-05-11
first of all I have to admin I do not understand all this.  We have a LOT of solaris, linux and aix systems.  I am going to prod systems and need to know if there is 100 megs available to install an app.  

df -k has been know to hang systems under very spacific instances.  
Is there something safer to use to check usable disk space ?

Question by:TIMFOX123
    LVL 11

    Assisted Solution

    df is very safe the one of the only reasons it would hang is on NFS files systems where it couldn't communicate with the nfs server. If you are hanging on df without NFS file systems you could have other major issues.

    As far as the commands you can do a df -h on solaris 10 to get file system usage in MB, GB and TB. You can also use du -soh on specific folders/files that will list how much space it is using.

    Also to mitigate the full lis of file systems since you know you aren't going to install to /var you can look at specific filesystems like df -h /opt or cd to /opt and run df -h .
    LVL 5

    Expert Comment

    If you are indeed hanging because of network mounts:
    LVL 20

    Assisted Solution

    Agree with the above, if `df -k` hangs, the system needs fixing anyway - And you may be the first to notice ;-)

    `df -l` only checks local filesystems, so won't hang on stale NFS mounts and is probably better for your purposes.

    If you did `ps -ef |grep df` beforehand to check there were no hung `df` processes, you could de-risk it even further
    LVL 76

    Expert Comment


    Others have addressed the likely cause of the hanging condition.

    Setup if you do not already have a monitor system that keeps track of Disk space use and refer to that.
    cacti ( is one such simple thing to setup (relies on SNMP) to collect data.

    If your system/s have been configured for SNMP, you can use snmpwalk -v 2c -c 'community_name' ip
    These three tell you the index, drive, allocation units, total space, used space

    Author Comment


    you are dead on what I need. what does a hung df process look like ?


    Author Comment


    let me redefine it.  what can I put before a df -l that would not execute df -l  there was any chance of it hanging the box ?  
    LVL 11

    Accepted Solution

    if you do a
    ps -ef  | grep -v ps | grep -c "df"

    Open in new window

    the -c is for the count, if it is greater than 0 then you have df processes running.
    LVL 76

    Assisted Solution

    to diagnose a df that are hanging, run mount
    if it hangs as well that means you have an NFS mount that is inaccessible.
    tail /var/log/messages /var/adm/messages (Solaris) to see if there are nfs error soft saying that a mount can not be accessed.
    First you have to know what that mounted system is supposed to do, if you forcibly unmount -f and it is used for mail, either the mail will be stored locally and could lead to loss of email or the system running over space, if the path with the mount point does not exist, the emails will bounce.

    Author Closing Comment

    this rocks


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    nodeip 9 60
    unix/linux AWK  Script question 6 55
    Remote Change Dates on AIX Automation 7 38
    Sed question 2 25
    When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
    Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
    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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    729 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

    17 Experts available now in Live!

    Get 1:1 Help Now