Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

is there a substatute for df -k ?

Posted on 2011-05-02
9
Medium Priority
?
460 Views
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 ?





0
Comment
Question by:TIMFOX123
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 11

Assisted Solution

by:jgiordano
jgiordano earned 1000 total points
ID: 35507827
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 .
0
 
LVL 5

Expert Comment

by:jason987
ID: 35507990
If you are indeed hanging because of network mounts:

http://www.brandonhutchinson.com/nfs_timeouts.html
0
 
LVL 21

Assisted Solution

by:tfewster
tfewster earned 500 total points
ID: 35508376
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 81

Expert Comment

by:arnold
ID: 35508509

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 (cacti.net) 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
HOST-RESOURCES-MIB::hrStorageIndex
HOST-RESOURCES-MIB::hrStorageDescr
HOST-RESOURCES-MIB::hrStorageAllocationUnits
HOST-RESOURCES-MIB::hrStorageSize
HOST-RESOURCES-MIB::hrStorageUsed
These three tell you the index, drive, allocation units, total space, used space
0
 

Author Comment

by:TIMFOX123
ID: 35509610
tfewster:

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

0
 

Author Comment

by:TIMFOX123
ID: 35509617
tfewster:

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 ?  
0
 
LVL 11

Accepted Solution

by:
jgiordano earned 1000 total points
ID: 35509737
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.
0
 
LVL 81

Assisted Solution

by:arnold
arnold earned 500 total points
ID: 35509803
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.
0
 

Author Closing Comment

by:TIMFOX123
ID: 35513524
this rocks

thanks
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

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…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

564 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