This content is submitted by a BigAdmin user. It has not been reviewed for technical accuracy by Sun Microsystems, though it may have been lightly edited to improve readability. If you find an error or would like to comment on the article, please contact the submitter or use the comment field at the bottom of the article.
Community submissions may not follow Sun trademark guidelines. For information on Sun trademarks, please see http://www.sun.com/suntrademarks/.
Automating Unmirror and Remirror for Solaris Volume Manager Volumes
Victor Feng, November 2007
Introduction
When performing operating system or application system upgrades or changes, a cautious system administrator unmirrors the
volumes so there are two independent systems. Then, if the upgrades or changes go wrong in one system, the second system
can kick in right away. After finishing the upgrades or changes, the system administrator needs to recreate mirrors
for the system.
The unmirror script provided with this article automates the following tasks:
Unmirror the volumes so that one system is split into two systems.
Prepare the second system to be ready for use in the event of a failure.
Re-create the mirrors for the first system as they existed before.
Note: The unmirror script and the following procedure were tested with the Solaris 10 Operating System, but they should also work
with previous Solaris versions. The unmirror script unmirrors and remirrors Solaris Volume Manager based RAID 1, 0+1 volumes for UFS
file systems. The script leaves other RAID type volumes and simple partitions alone.
How to Use the unmirror Script
1. As root, run the following command:
# ./unmirror
2. Perform your system upgrades or changes.
3. If the upgrades or changes succeed, as root, run the following command:
# ./remirror
Or, instead, if the upgrades or changes fail, boot from the root disk of the second system.
Explanation of the unmirror Script
The unmirror script generates three additional scripts:
unmirror_cont
remirror
remirror_cont
The specific contents of the unmirror_cont, remirror, and
remirror_cont scripts vary based on your volumes.
Here's an example of the unmirror_cont script for this scenario:
Here's an example of the remirror script for this scenario:
Here's an example of the remirror_cont script for this scenario:
After detaching submirrors, the unmirror script creates a symbolic link file in
/etc/rc3.d for unmirror_cont and reboots the system
so that the link file continues to finish the unmirroring after the reboot. After finishing upgrades or changes,
you can then run the remirror script to re-create the mirrors that existed before on the system.
The remirror script creates a symbolic link file in /etc/rc3.d
for remirror_cont before rebooting the system, and the link file continues to finish
the mirroring after the reboot.
The unmirror script unmirrors and remirrors Solaris Volume Manager based RAID 1, 0+1 volumes.
The file system for the volumes is UFS. The script leaves other RAID type volumes and simple partitions in the system alone.
The unmirror script does not run the
metaclear submirror command, and it does not remove the metadatabase,
because it does not need to re-create the submirror and the metadatabase when it remirrors the volumes.
The core task of the unmirror script is to read md.cf row by row.
In the previous example, each RAID 1 volume has three rows, starting with first row with -m.
A row counter (rows) is set to 2 when the first row is found. The counter is reduced by 1 after
the next row is read. When the row counter is 1, the Unmirror_PrepareRemirror function is called
to unmirror the system and to continue to prepare the other three scripts. The program also determines whether a submirror
is a physical partition or a volume (for example, RAID 0). If both the second and the third parameters are 1, the
submirror is a physical partition.
Note: Throughout the whole unmirroring process, the vfstab2 file is updated so that it will be used as
/etc/vfstab for the second system.
The information and links on this page have been provided by a BigAdmin user. The submitter is solely responsible for such information and links. Sun is not responsible for the availability of external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss caused by or in connection with use of or reliance on the information posted here, or goods or services available on or through any external site or resource.
Comments (latest comments first)
Discuss and comment on this resource in the BigAdmin Wiki
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.