Listing 1 lst_disks
#!/usr/bin/ksh
#
# Name: lst_disks
#
# Purpose: Shows LVs by volume group, including disk useage, LV placement and more
#
# Description: lst_disks gives a hdisk by hdisk (which may be a RAID array)
# report of Physical Volumes, Volume Groups and Logical Volumes.
# With it you can easily find out what disk a LV is on, how big it is,
# its intra-disk ditrubution, and the mount point if it a filesystem.
# It will show how much space is left on a logical disk,
# and the Physical Partition (PP) size of the Volume Group.
#
# Date: 1995
#
# Required Parameters:
# -------------------------------------------------------------------------
# None.
#
# Optional Parameters:
# -------------------------------------------------------------------------
# None.
#
# Change History:
#
# Date Name Comments
# _________________________________________________________________________
#
SEP="---------------------------------------------------------------------------"
SEP1="==========================================================================="
echo $0 started at $(date).
echo $SEP1
echo PHYSICAL DISK USAGE for $(uname -n) on $(date)
echo $SEP1
lspv | sort -n +0.5 | while read DNAME PVID VG
do
if [[ $DNAME > " " ]]
then
lspv '-l' $DNAME 2>>/dev/null
if [[ $VG != "None" ]]
then
echo
lspv $DNAME 2>>/dev/null
echo $SEP
fi
fi
done
echo $0 ended at $(date).
exit
|