Veritas Root Disk Restore

Typical scenario:
You (or someone else :-) have put wrong shell for root
in /etc/passwd... or overwritten libc.so.1...

There are many other situations when you urgently need to
make small modifications to root or usr filesystem while
being booted from the net.

If such filesystem is under Veritas VM control,
the standard (and rather boring) way of doing it would be:

- figure out which physical slice this submirror is on
- boot from the net or CD
- fsck and mount that physical slice
- do modifications
- remove the "rootdev:" and "set vxio:" lines from $MOUNTPOINT/etc/system
- make sure only install-db flag file exists in $MOUNTPOINT/etc/vx/reconfig.d/state.d
- modify $MOUNTPOINT/etc/vfstab so that affected filesystem is on a physical
partition rather than on a Veritas volume (it is safer to do it for ALL
filesystems on the root disk)
- reboot from the disk
- encapsulate the root disk again
- re-create and attach other submirrors

It is described in greater details in Veritas Volume Manager Administrator's
guide and in Sun infodoc 12072 (search on SunSolve).

Bad news is, if you are not a VxVM expert, there are too many things that
may go wrong while you are experimenting with the only copy of your rootvol.

The procedure suggested below, makes such modifications much easier and
more reliable by making it possible, to access rootdg volumes straight from
the net booted diskless client.

The Jumpstart client must have the VRTSvxvm package installed.
BTW Veritas backup client can be installed, too, so that you could
not only access the volumes, but also restore the necessary files,
or even the whole filesystems. The only requirement is to have your
private region information not corrupted on at least one rootdg disk.

The procedure is as follows:
Get to OBP "ok" prompt and boot single-user from the net:
boot net -s

wait for the shell prompt and run the script:
/SITE-specific/Scripts/VxImportRootdg

Now, all your rootdg volumes sould be started,
and you can access them via /dev/vx/*dsk/rootdg/VOLUME_NAME

Run vxprint to make sure you can see the necessary volumes,
and that they are enabled

Make your modifications, or (for full restore) newfs and restore.

Reboot from the disk