Labeling Multiple Disks for Use With Volume Manager SoftwareDonald S. Ragbirsingh, April 2007 IntroductionTypically, an admin has to add many disks to production systems. This tip provides a time-saving procedure for labeling multiple disks for use with volume manager software. If you do the procedure appropriately, you can cut down disaster recovery times. The procedure works with all versions of the Solaris Operating System that use VERITAS Volume Manager (VxVM) software as the main disk management utility. Caution: Be sure you use this procedure appropriately or you might cause
undesirable consequences. For example, if your boot disk is I usually work with EMC, CLARiiON and STK type disks, but this procedure works with any type of disk. Most EMC/CLARiiON and STK disks need to be labeled before use. (Editor's note: STK is short for StorageTek, now part of Sun Microsystems.) Step 1Create a command file (for example, label quit At the command line, write a label on the disk using the # format -s -f format.cmd c3t21d14 Repeat this step, as required, using a script if necessary:
for i in 15 16 17 18 19 20
do
format -s -f format.cmd c3t21d$i
echo "labeled c3t21d$i ..."
done
Step 2Use one of the new disks to create a prepared disk for VxVM, that is,
zero out all the partitions except slice 2. Note: This means you have to manually do one disk, for example, Save the Volume Table of Contents (VTOC) of this disk (in this example,
# prtvtoc /dev/rdsk/c3t21d5s2 > master_vtoc Step 3Copy the VTOC to a destination disk, for example, # fmthard -s /tmp/master_vtoc /dev/rdsk/c3t21d6s2 fmthard: New volume table of contents now in place. Repeat this step, as required, using a script if necessary:
for i in 14 15 16 17 18 19 20 21
do
fmthard -s /tmp/master_vtoc /dev/rdsk/c3t21d$i
echo "Re-partitioned c3t21d$i ..."
done
Try to avoid recalling backup tapes, that is, do not make mistakes! As an offshoot of this procedure, you can issue the following devastatingly simple, one-line command instead of using the VTOC file. However, the choice is up to you. prtvtoc /dev/rdsk/c3t21d5s2 | fmthard -s - /dev/rdsk/c3t21d13s2 ConclusionThe uses of this procedure are myriad. For example, if you wanted to add an
SVM mirror, you
could take the boot device ( prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2 Then it's trivial to start the mirroring process. You can add also spares, but I'd like to save that process for another tip. About the AuthorDonald Ragbirsingh works for his own company, Opentech Systems Inc. He has been involved in IT in the banking, insurance, and telecommunications industries for over 10 years in Canada. Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
| |||