Extra setup-security for Veritas VolumeManager

ESMvxbu is a solaris package which saves the entire setup for your VxVM installation, and helps you rebuild
it if you lose it.  It is also followed by some utility-scripts that will guide you through the job when you
want to move one or more volumes from one diskgroup to another. It wont ever harm data!
The saved setup will be rotated in 8 generations under /usr/vx/RESTORE -> RESTORE.7

Download the latest version HERE

The package is tested on VxVm 1.3 to 3.1, and is based entirely on standard vx-commands.
There is no guarantee it will work to regen diskgroups saved from one installation into another installation using an OLDER version of VxVM. (This due to dg-versions) The other way looks ok then..



WARNING: Due to changes in private-region-size, The default size was 1024 before 3.1, and became 2048 in 3.1, and something possibly happened in 3.2 as well. See http://seer.support.veritas.com/docs/234361.htm for more information about this. There are several ways to get around this problem.
1) Use some time to safely reinitialize your disks after an upgrade.
2) comment out the lines saying: /etc/vx/bin/vxdisksetup -i $PNAME
in the 1.make_DG script (and the utils/3.make_new_DG)
3) or, adding parameter privlen=1024 to the same command.
Well, I guess 1) is the safest :-)
esm/19.spet.2001

here is an example on how to install:

#/usr/sbin/pkgadd -d /tmp/ESMvxbu.bin

The following packages are available:
1 ESMvxbu Regeneration utility for VXVM
(sparc) 2.0 ,REV=1.1

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 1

Processing package instance <ESMvxbu> from </tmp/ESMvxbu.bin>

Regeneration utility for VXVM
(sparc) 2.0 ,REV=1.1

++++++++++++++++++++++++++++LICENCE AGREEMENT++++++++++++++++++++++++
x) Copyright 1986-2000 Espen Martinsen
Comments to: esm@pogostick.net.spam
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I would be happy if you sent me an Email telling me that you are
using this package.

Enjoy it !
 

Using </usr> as the package base directory.
## Processing package information.
## Processing system information.
1 package pathname is already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <ESMvxbu> [y,n,?] y
Installing Regeneration utility for VXVM as <ESMvxbu>

## Installing part 1 of 1.
/usr/vx/1.make_DG
/usr/vx/2.Restore_DG
/usr/vx/Save_All_DG
/usr/vx/Save_DG
/usr/vx/utils/1.save_info
/usr/vx/utils/2.remove_from_DG
/usr/vx/utils/3.make_new_DG
/usr/vx/utils/RUNME
/usr/vx/utils/count_configs
/usr/vx/utils/remove_disk
/usr/vx/utils/remove_volume
[ verifying class <none> ]
## Executing postinstall script.

Installation of <ESMvxbu> was successful.
#
Thats it.  Now, it's even configured to run via cron every night at 1 o'clock

#crontab -l | grep vx
0 1 * * * [ -x /usr/vx/Save_All_DG ] && /usr/vx/Save_All_DG /usr/vx

here's where it is installed:
#cd /usr/vx
#ls
1.make_DG 2.Restore_DG Save_All_DG Save_DG utils
#ls utils
1.save_info 3.make_new_DG count_configs remove_volume
2.remove_from_DG RUNME remove_disk

Here is how to use them:
Lets say we lost the diskgroup esmDG.....
#cd /usr/vx/RESTORE/esmDG
#../../1.make:DG esmDG
#../../2.Restore_DG esmDG
..and that's all. All you now have to do is mount he filesystems.  There is also a copy from the original vfstab-file here.
 

Now, let's say you want to move the volumes vol01, vol02 and vol03 from esmDG to newDG
First, you have to be sure it is possible. That is, you have to move subdisks involved in other volumes away from the
disks that belongs to vol01, vol02 and vol03, so that the disks as well can be moved.
At last, you have to stop all processes running on the volumes, and umount them. Then, you're ready!
CAVEAT: Make sure no names in the target DG is the same as in your moved volumes, this goes for sd, plex and volumes (and disks of course)

#cd /usr/vx/utils
#1.save_info esmDG vol01 vol02 vol03
#2.remove_from_DG esmDG vol01 vol02 vol03
(if this step fails, it tries to tell you why, fix it, and run step 2 again until it succedes)
#3.make_new_DG newDG
(newDG can either be an already existing diskgroup, or a non-existing (then it wiull be created)

That's all, again, all you have to do is mount the filesystems. remember they are in a new dg now, so you have to edit /etc/vfstab.
 

Oslo, 27.april 2000
Espen Martinsen
esm@pogostick.net.spam