Wed Aug 25 15:53:33 PDT 1999 - Rodney NOTE: This is a quick readme of notes pending the creation of a real manpage for the script. Steps: Copy the vxclone script to the server cd to directory containing vxlcone cp vxclone /opt/local/bin chmod 744 /opt/local/bin/vxclone Target disk should not be part of volume manager If it is (and not part of disk group), disable the device in volume manager: vxdiskadm option 11 input device name, ie: c14t49d0 If you have an unused disk that is part of a disk group, first remove it from the disk group, then perform the step above. add the device to /etc/vx/disks.exclude so that veritas will not attempt to use it again. echo "c14t49d0" >> /etc/vx/disks.exclude partition the drive with the appropriate label. ( one optional way to label if you are doing multiple systems with the same drive configuration is to use fmthard. First define a set of drives with format, then use prtvtoc -h to save the partition info to a set of files. Then use fmthard to update the other drives. For example: prtvtoc -h /dev/rdsk/c14t49d0s2 > /var/tmp/boot_drive0_vtoc cat /var/tmp/boot_drive0_vtoc | fmthard -s - /dev/rdsk/s2 ie: cat boot_drive0_vtoc | fmthard -s - /dev/rdsk/c14t48d0s2 cp vxclone.conf /etc/vxclone.conf vi /etc/vxclone.conf and edit to add the boot drive info The filesystems need to be at least big enough to hold the current data. Preferably it should be the same partition size as the source partitions so that you do not have to worry about running out of space. You should have at least one swap partition, but it is not necessary to duplicate all of the swap space for this drive. Because of this it is possible to combine root filesystems that are spread across 2 veritas rootdg drives onto a single vxclone disk. For example the source looks like: Filesystem kbytes used avail capacity Mounted on /dev/vx/dsk/rootvol 1018382 462272 495008 49% / /dev/vx/dsk/var 2002599 401963 1540559 21% /var /dev/vx/dsk/opt 1546003 62996 1421167 5% /opt /dev/vx/dsk/tmp 2002599 28 1942494 1% /var/tmp And the target drive is labeled with: Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 584 1.00GB (585/0/0) 2100735 1 swap wu 585 - 1734 1.97GB (1150/0/0) 4129650 2 backup wu 0 - 4923 8.43GB (4924/0/0) 17682084 3 unassigned wm 1735 - 2884 1.97GB (1150/0/0) 4129650 4 var wm 2885 - 3751 1.48GB (867/0/0) 3113397 5 unassigned wm 3752 - 4923 2.01GB (1172/0/0) 4208652 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 Now create the /etc/vxclone.conf file: /:rootvol:c14t49d0s0 # root filesystem swap::c14t49d0s1 # primary swap partition /opt:opt:c14t49d0s3 # /opt filesystem /var:var:c14t49d0s4 # /var filesystem /var/tmp:tmp:c14t49d0s5 # /var/tmp filesystem Now add vxclone to the root crontab. Typically it should only need to be run once a week. If you have volatile root filesystems, ie on a development system, you might want to run the script on a daily basis. The following entry would run the script once a week early Sunday morning at 3:15am: 15 3 * * 0 /opt/local/bin/vxclone > /dev/null When the vxclone script is running, if you need to stop it, issue a kill command with no arguments. As soon as the current command being executed is completed, vxclone will properly exit. If it is currently dumping/restoring a filesystem, it could be 20-30 minutes or longer before it exits. For example: kill `cat /var/spool/locks/vxclone.lock.*` or just use ps: ps -ef | grep vxclone root 25623 25622 0 13:59:00 ? 0:00 /bin/sh /opt/local/bin/vxclone root 25622 1505 0 13:59:00 ? 0:00 sh -c /opt/local/bin/vxclone > /dev/null kill 25623 If you must kill it immediately, you will have to use kill -9 on the process. If you do this, you will have to manually remove the /var/spool/locks/vxclone.lock.* file, as well as manually umount and remove the /tmp/vxclone mount points. You also will want to create a devalias for the boot clone drive and add it to the list of possible boot devices. For Fiber drives you can use ls to get the device path and WWN number of the drive on slice 0: ie: ls -l /dev/dsk/c14t48d0s0 lrwxrwxrwx 1 root root 71 Jul 23 11:32 /dev/dsk/c14t48d0s0 -> ../../devices/sbus@4d,0/SUNW,socal@0,0/sf@1,0/ssd@w220000203722d211,0:a The device path used by nvalias is: /sbus@4d,0/SUNW,socal@0,0/sf@1,0/ssd@w220000203722d211,0:a Halt the system and create a devalias for the clone drive: ok> nvalias clonedisk /sbus@4d,0/SUNW,socal@0,0/sf@1,0/ssd@w220000203722d211,0:a Then set the boot device to boot the fiberdisk, vx mirror disk, and then clone: ok> setenv boot-device fiberdisk vx-CAB4-TR3-FS0 clonedisk NOTE: The veritas mirror drive (vx-???) will vary on each system. reboot the system.