Operating System - Linux
1752709 Members
5586 Online
108789 Solutions
New Discussion юеВ

Re: shell script for disk space in GB

 
SOLVED
Go to solution
Muthukumar_5
Honored Contributor

Re: shell script for disk space in GB

Use this:

# bdf | awk 'BEGIN{ print "Filesystem GBytes Used avail %used Mounted on"}{ if ($0 ~! /Filesystem/) { printf "%s %6.5f %6.5f %6.5f %3s %s\n",$1,$2/1024/1024,$3/1024/1024,$4/1024/1024,$5,$6;}}'

hth.
Easy to suggest when don't know about the problem!
Shivkumar
Super Advisor

Re: shell script for disk space in GB

Thanks everyone for helping me!!

I have checked that both disks are available on the servers. Attached disks and SAN disk.

How to find out how much SAN disk is used, free ?

I mean i want separation of usage of SAN and attached disks both ?

Thanks,
Shiv

Onyedika Onwudiwe
Occasional Advisor

Re: shell script for disk space in GB

Shivkumar,

Depends on what you are looking for and from what perspective. Disk space available per LV, per VG. You might also have disks available on your system that have not been pvcreated but are available. Can you be more specific?
Shivkumar
Super Advisor

Re: shell script for disk space in GB

How to find out disks/disk space available on the systems that have not been pvcreated but are available ?
James R. Ferguson
Acclaimed Contributor

Re: shell script for disk space in GB

Hi SHiv:

# diskinfo /dev/rdsk/cXtYdZ

...will return the size of a disk. Note the use of the raw (character) device -- 'rdsk'.

See the manpages for more information, too.

Regards!

...JRF...
Arunvijai_4
Honored Contributor

Re: shell script for disk space in GB

Hi Shiv,

You can use the attached script finding out un-used disks,

Note : It works when you have Solution Enabler installed on your server.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Shivkumar
Super Advisor

Re: shell script for disk space in GB

What is solution enabler ? how to find out whether Solution Enabler is availaber on my servers ?
Bill Hassell
Honored Contributor

Re: shell script for disk space in GB

The syminq program is part of the EMC disk utilities package for newer disk arrays. Since EMC disk arrays are very expensive, you would definitely know if you have this package of tools.

As far as locating disks on your system which are not used, that is, not part of any disk volume group, you can run SAM and in the disks section, start creating a new volume group. The first step in SAM will show you potential disks you can use for a new volume or to extend an existing volume.


Bill Hassell, sysadmin
Onur Karakan
Advisor

Re: shell script for disk space in GB

Here is the script for disk space in GB.

#!/usr/bin/ksh

echo "Filesystem Gbytes used avail %used Mounted on"

bdf $1 | grep -v Filesystem | awk '{ printf("%s %10d %10d %10d %4s %s\n",$1,$2/1024/1024,$3/1024/1024,$4/1024/1024,$5,$6)}'


And you can find the script for used and available space for disks as ana attachment. It gives you detailed information about PVs,VGs and LVs. you only have to add your mail address to script.