Cover V10, I09

Article
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Listing 1
Listing 2
Listing 3
Listing 4
Sidebar 1
Sidebar 2
Sidebar 3
Table 1
Table 2
Table 3
Table 4

sep2001.tar


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