Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on exportvg 1

Status
Not open for further replies.

sbrews

Technical User
Jun 11, 2003
413
0
0
US
I have 2 systems A and B. They both know about datavg.
I want node B to "completely forget" what it knows about datavg.

If I do an

exportvg datavg

on system B, will it update the vg info on the disk (which is varied on/mounted on system A) or just remove it from the ODM?

 
thanks - thats what I thought but wasnt sure.
 
You can even exportvg a VG that a system once had, but now no longer can access the disks for it (moved to another system, or just removed) in order to forget about that VG.


HTH,

p5wizard
 
Here's a script to remove a vg

Code:
#!/bin/ksh
#
# This script performs a basic cleanup of a volume group in 
# order to provide a somewhat secure remove of data.  This is 
# obviously not DOD or financial system grade data erasure, 
# but may be sufficient for many enviroments when turning 
# systems over to a recycling company or at the end of an 
# offsite disaster recovery test.  
#
# The script does the following actions:
#    For each volume in the indicated volume group:
#	- kill any processes using file systems in the volume group
#	- recursively remove all files in the volume
#	- remove the file system with rmfs
#    - once all the volumes are removed, remove the volume group
#      via reducevg.
#
# For best results,
# follow up the deletion of the volume group with a creation
# of a new volume group re-using the PVs.
#
# Andy Welter
# January 2005
#

VG=$1
TESTRUN=$2
if [ "$VG" = "" ]; then
        print "ERROR: must specify a volume group"
        exit 1
fi

print "!!!!!!!! WARNING !!!!!!!"
print "!!! This script will !!!"
print "!!! delete all data  !!!"
print "!!! on the following !!!"
print "!!! volume group:    !!!"
print
lsvg -l $VG
print "Whack $VG ?\n\n"
read ANS
case $ANS in
        y|Y) print "Ok, here we go"
                sleep 2
                ;;
        *) print "Quitting."
                exit 1
                ;;
esac
lsvg -l $VG | sort -b +6r| egrep "jfs |jfs2 " | grep -v "^LV NAME" | \
        while read LVNAME TYPE LP PP PV STATE MOUNT; do
        print "removing $MOUNT..." >&2
        if [ "$TESTRUN" = "" ]; then
                fuser -ck $MOUNT
                find $MOUNT -xdev -depth -exec rm {} \;
                ls -alR $MOUNT
                umount $MOUNT
                rmfs $MOUNT
        else
                print "test: $MOUNT"
        fi
done
lspv  | while read PVNAME VOLID CURVG STATUS; do
        case $CURVG in
        $VG) print "remove $PVNAME from $VG"
                if [ "$TESTRUN" = "" ]; then
                        reducevg -df $VG $PVNAME
                fi
                ;;
        *) print "ignore $PVNAME... belongs to $CURVG"
                ;;
        esac
done

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top