Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Keith Moodie <moodiek@dnr.qld.gov.au>
Subject: Re: Disk Space 4.0d
Date: 1999/09/29	[thread overview]
Message-ID: <37F14FFB.41C6@dnr.qld.gov.au> (raw)
In-Reply-To: 37f51547.84822970@news.dal.ca

Hi,
You may like to try the script below it gives output like

> free

Wed Sep 29 09:29:10 EST 1999
Filesystem       GB      Free   Used%
/                 177        79     51%                         rz18a
/v1             2.603     1.190     50%                         rz16h
/v2            33.918     3.684     90%                        viper1
/usr            7.566     0.914     88%                          usr0
/dev/fd             0         0    100%                            fd


#!/bin/sh
#
# free  display disk space in GB and free space
#

echo ""
date
df -ikn | nawk '

/tmp_mnt/ { next}
/\/proc/ { next}

{
if ( substr($0,1,4) == "File")
{print "Filesystem       GB      Free   Used%"}
else
    {
    fsys = $1;
    tot  = $2/1024;
    used = $3/1024;
    free = $4/1024;
    if ( tot > 1024 )
    {
        # > 1 GB print like "  1.123"
        tot   = sprintf( "%7.3f", tot / 1024.0);
        used  = sprintf( "%7.3f", used / 1024.0);
        free  = sprintf( "%7.3f", free / 1024.0);
    }
    else
    {
        # < 1 GB print like "    123"
        tot    = sprintf( "%7d", tot);
        used   = sprintf( "%7d", used);
        free   = sprintf( "%7d", free);
    }
    cap  = $5;
    iusd = $6;
    ifre = $7;
    icap = $8;
    mnt  = $9;
    imsg = ""
    if ( match ( icap, "[5-9][0-9]") > 0) imsg = "Inodes " icap;
    f_sys = fsys;
    gsub( "/dev/", "", f_sys);
    gsub( "usr0#", "", f_sys);    #pretty up the names of ADVFS domains
    gsub( "viper1#", "", f_sys);
    gsub( "viper2#", "", f_sys);
    gsub( "viper3#", "", f_sys);
    gsub( "viper4#", "", f_sys);
    gsub( "elite#", "", f_sys);
    #printf ( "%-12s  %6.3f %6d   %6s    %s\n", mnt, tot, free, cap,
imsg);
    printf ( "%-12s  %s   %s  %6s    %15s %10s\n", mnt, tot, free, cap,
imsg, f_sys);
    }
}
END{ print "" }
'

# End of script


HxMan wrote:
> 
> We are starting to run low on disk space on our 2100 server.... We do
> have a RAID pedistal with 2.1 gig drives....... I would like to know
> if there is any way to find out what file systems expands what
> disks.... Also the command df -k
> Filesystem  1024-blocks        Used   Available Capacity  Mounted on
> /dev/re1c      12192746     9401811     1571660    86%    /data
> 
> So to figure out megabytes I divide by 1024?????
> 
> So what does the above translate to......
> 
> Thanks

-- 

Keith Moodie
moodiek@dnr.qld.gov.au



  parent reply	other threads:[~1999-09-29  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-28  4:00 Disk Space 4.0d HxMan
1999-09-29  4:00 ` Ed Wensell III aka THE StormRaiser
1999-09-29  4:00 ` Keith Moodie [this message]
1999-10-03  4:00 ` Marco Benton
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox