Added client work scripts
[clearscm.git] / clients / HP / bin / lvs
1 #!/bin/ksh
2 ################################################################################
3 #
4 # File:         lvs
5 # RCS:          $Header: lvs,v 1.1 97/04/08 15:27:22 defaria Exp $
6 # Description:  A script to list the LVM's and their disk devices
7 # Author:       Jeff Bralley (Contrator), California Language Labs
8 # Created:      Tue Apr  8 14:35:00 PDT 1997
9 # Modified:     Tue Apr  8 15:11:13 PDT 1997 Andrew DeFaria (defaria@cup.hp.com)
10 # Language:     Korn Shell
11 #
12 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
13 #
14 ################################################################################
15 print "Mount Point\tLogical Volume\t\tPhysical Volume"
16 echo '--------------- ----------------------- ---------------'
17
18 vgdisplay               |
19   grep '^VG Name'       |
20   awk '{print $3}'      |
21   while read vgName; do
22     for volumeName in $vgName/*; do
23       if [ ! -b $volumeName ]; then
24         continue
25       fi
26       pd=$(lvdisplay -v $volumeName | grep '^[         ]*/dev/dsk' | awk '{print $1}')
27       mp=$(bdf $volumeName 2> /dev/null | grep -v Filesystem | awk '{print $NF}')
28       if [ "$mp" = "" ]; then
29         mp=swap
30       fi
31       print "$mp\t\t$volumeName\t\t$pd"
32     done
33 done