This section provides guidelines can assist you in creating mirrors. This section also provides performance guidelines for the mirrors that you create.
Before you create a mirror, create the RAID-0 (stripe or concatenation) volumes that comprise the mirror.
When creating a mirror, first create a one-way mirror, then attach a second submirror. This strategy starts a resynchronization operation. This strategy also ensures that data is not corrupted. You can also create a one-way mirror for use as a future two-way or multi-way mirror.
You can create a two-way mirror, three-way mirror, or four-way mirror from a one-way mirror with a single command. You can speed the creation process by creating all submirrors with a single command. Use this process only if you are not mirroring existing data and if you are comfortable destroying the data on all of the submirrors.
You can create a RAID-1 volume from an existing file system that is built on a slice. Only the single slice may be included in the primary RAID-0 volume (submirror). If you are mirroring root or other system-critical file systems, all submirrors must consist of only a single slice.
Use the swap -l command to check for all swap devices. Each slice that is specified as swap must be mirrored independently from the remaining swap slices.
The Enhanced Storage tool within the Solaris Management Console does not support unmirroring root (/), /opt, /usr, or swap. In fact, the tool does not support unmirroring any file system that cannot be unmounted while the system is running. Instead, use the command-line procedure for these file systems.
Use submirrors of the same size. Submirrors of different sizes result in unused disk space.
Use only similarly configured submirrors within a mirror. In particular, if you create a mirror with an unlabeled submirror, you cannot attach any submirrors that contain disk labels.
You can have a mirrored file system in which the first submirror attached does not start on cylinder 0. All additional submirrors you attach must also not start on cylinder 0. If you attempt to attach a submirror starting in this situation, the following error message displays:
can't attach labeled submirror to an unlabeled mirror
Either all submirrors intended for use within a specific mirror must start on cylinder 0, or all of the submirrors must not start on cylinder 0.
Starting cylinders do not have to be the same across all submirrors. However, all submirrors must either include or not include cylinder 0.
You can improve a mirror's performance by adding additional state database replicas before you create the mirror. As a general rule, add two additional replicas for each mirror you add to the system. Solaris Volume Manager uses these additional replicas to store the dirty region log (DRL), which is used to provide optimized resynchronization. By providing adequate numbers of replicas, you can minimize I/O impact on RAID-1 volume performance. Using at least two replicas on the same disks or controllers as the mirror that the replicas log also helps to improve overall performance.
Only mount the mirror device directly. Do not try to mount a submirror directly, unless the submirror is offline and mounted read-only. Do not mount a slice that is part of a submirror. This process could destroy data and crash the system.
Keep the slices of different submirrors on different disks and controllers. Data protection is diminished considerably if slices of two or more submirrors of the same mirror are on the same disk. Likewise, organize submirrors across separate controllers, because controllers and associated cables tend to fail more often than disks. This practice also improves mirror performance.
Use the same type of disks and controllers in a single mirror. Particularly in old SCSI storage devices, different models or different brands of disks or controllers can have widely varying performance. If disks and controller that have the different performance levels are used in a single mirror, performance can degrade significantly.
Mirroring might improve read performance, but write performance is always degraded. Mirroring improves read performance only in threaded or asynchronous I/O situations. A single thread reading from the volume does not provide a performance gain.
You can experiment with the mirror read policies can improve performance. For example, the default read mode is to alternate reads in a round-robin fashion among the disks. This policy is the default because round-robin tends to work best for UFS multiuser, multiprocessor activity.
In some cases, the geometric read option improves performance by minimizing head motion and access time. This option is most effective when:
There is only one slice per disk
Only one process at a time is using the slice or file system
I/O patterns are highly sequential or when all accesses are read
You can attach a submirror to a mirror without interrupting service. You attach submirrors to mirrors to create two-way, three-way, and four-way mirrors.
When you place a submirror offline, you prevent the mirror from reading from and writing to the submirror. However, you preserve the submirror's logical association to the mirror. While the submirror is offline, Solaris Volume Manager keeps track of all writes to the mirror. The writes are written to the submirror when it is brought back online. By performing an optimized resynchronization, Solaris Volume Manager only has to resynchronize data that has changed, not the entire submirror. When you detach a submirror, you sever its logical association to the mirror. Typically, you place a submirror offline to perform maintenance. You detach a submirror to remove it.
The following options are available to optimize mirror performance:
Mirror read policy
Mirror write policy
The order in which mirrors are resynchronized (pass number)
You can define mirror options when you initially create the mirror. You can also change mirror options after a mirror has been set up and is running. For tasks related to changing these options, see How to Change RAID-1 Volume Options.
Table 10-1 RAID-1 Volume Read Policies
Table 10-2 RAID-1 Volume Write Policies
The pass number, a number in the range 0–9, determines the order in which a particular mirror is resynchronized during a system reboot. The default pass number is 1. The lower pass numbers are resynchronized first. If zero is used, the mirror resynchronization is skipped. A pass number of zero should be used only for mirrors that are mounted as read-only. Mirrors with the same pass number are resynchronized at the same time.
The metastat command of Solaris Volume Manager reports status information on RAID 1 volumes and submirrors. The status information helps you to determine if maintenance action is required on a RAID-1 volume. The following table explains submirror states shown when you run the metastat command on a RAID-1 volume.
Table 10-3 Submirror States
Additionally, for each slice in a submirror, the metastat command shows the following:
Indicates the device name of the slice in the stripe
Indicates the block on which the slice begins
Indicates if the slice contains a state database replica
Indicates the state of the slice
Indicates that a slice is being used as a hot spare for a failed slice
The submirror state only provides general information on the status of the submirror. The slice state is perhaps the most important information to review when you are troubleshooting mirror errors. If the submirror reports a “Needs Maintenance” state, you must refer to the slice state for more information.
You take a different recovery action depending on if the slice is in the “Maintenance” state or in the “Last Erred” state. If you only have slices in the “Maintenance” state, they can be repaired in any order. If you have slices both in the “Maintenance” state and in the “Last Erred” state, you must fix the slices in the “Maintenance” state first. Once the slices in the “Maintenance” state have been fixed, then fix the slices in the “Last Erred” state. For more information, see Overview of Replacing and Enabling Components in RAID-1 and RAID-5 Volumes.
The following table explains the slice states for submirrors and possible actions to take.
Table 10-4 Submirror Slice States