[SunHELP] Listing Disk Sizes...

Jeff_Jacobs at aoncons.com Jeff_Jacobs at aoncons.com
Mon Feb 3 10:25:05 CST 2003


Use the following script:


#!/bin/ksh
########################################################################
#        AUTHOR: Jeff Jacobs
#       CREATED: Date: 01/15/03     Time: 14:23:44
#  LAST CHANGED: Date: 01/15/03     Time: 14:23:44
#  PROGRAM NAME: diskinfo.sh
#      HOME DIR: /home/cjj2533
#   DESCRIPTION: Retrieves the attached disk info
#        SYNTAX: diskinfo.sh
########################################################################
#     REVISIONS:
########################################################################
#.......................................................................
# Set up environment
#.......................................................................

# Build the format command file

COMMAND_FILE=/tmp/diskinfo_commands.txt
NUMBER=`ls /dev/dsk|grep s2|wc -l`
CURRNUM=0

# Account for the cdrom drive
NUMBER=$(($NUMBER-1))

cp /dev/null $COMMAND_FILE

while [ $CURRNUM -lt $NUMBER ]
do
        echo "disk $CURRNUM" >> $COMMAND_FILE
        echo inq >> $COMMAND_FILE
        echo "! cat /dev/null" >> $COMMAND_FILE
        CURRNUM=$(($CURRNUM+1))
done


#.......................................................................
# End environment setup
#.......................................................................
# Begin Main
#.......................................................................


format -f $COMMAND_FILE|grep -iv format|grep -v " - "|grep -v quit

#.......................................................................
# End Main
#.......................................................................







"Wyatt Draggoo" <wyatt at draggoo.com>
Sent by: sunhelp-bounces at sunhelp.org
02/02/2003 05:44 PM
 
        To:     sunhelp at sunhelp.org
        cc: 
        Subject:        [SunHELP] Listing Disk Sizes...


Afternoon all,

I need to get a list of the disks attached to an Ultra 5, along with the
total size of the disk, in a script under Solaris 7.  Most of the commands
that deal with sizes (df, du) are per-partition, and format, which lists
the disks, is interactive, which doesn't help a lot in a script.

I'm sure there is a command to get this list, but a search through this
list archive and both google and groups.google hasn't turned up anything
for me.

Any ideas?

Thanks,
Wyatt

--
Wyatt Draggoo
_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp


More information about the SunHELP mailing list