This procedure shows you how to create a two-way mirror. If you want to create a three-way mirror or a four-way mirror, use the same procedure.
Check Prerequisites for Creating Solaris Volume Manager Components and Creating and Maintaining RAID-1 Volumes.
Create two stripes or concatenations. These components become the submirrors.
See How to Create a RAID-0 (Stripe) Volume or How to Create a RAID-0 (Concatenation) Volume.
To create the mirror, use one of the following methods:
From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node, then choose Action⇒Create Volume and follow the onscreen instructions. For more information, see the online help.
Use the following form of the metainit command to create a one-way mirror:
# metainit volume-name -m submirror-name |
Specifies the name of the volume to create
Specifies to create a mirror
Specifies the name of the component that will be the first submirror in the mirror
See the following examples and the metainit(1M) man page for more information.
To add the second submirror, use one of the following methods:
From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node, then choose the mirror you want to modify. Choose Action⇒Properties, then the Submirrors. Follow the onscreen instructions to attach the submirror. For more information, see the online help.
Use the following form of the metattach command:
# metattach volume-name submirror-name |
Specifies the name of the RAID-1 volume on which to add the submirror
Specifies the name of the component that will be the second submirror attached to the mirror
See the following examples and the metattach(1M) man page for more information.
# metainit d51 1 1 c0t0d0s2 d51: Concat/Stripe is setup # metainit d52 1 1 c1t0d0s2 d52: Concat/Stripe is setup # metainit d50 -m d51 d50: Mirror is setup # metattach d50 d52 d50: Submirror d52 is attached |
This example shows you how to create the two-way mirror, d50. The metainit command creates two submirrors (d51 and d52), which are RAID-0 volumes. The metainit -m command creates the one-way mirror from the d51 RAID-0 volume. The metattach command attaches d52, creating a two-way mirror and causing a resynchronization. Any data on the attached submirror is overwritten by the other submirror during the resynchronization.
# metainit d51 1 1 c0t0d0s2 d51: Concat/Stripe is setup # metainit d52 1 1 c1t0d0s2 d52: Concat/Stripe is setup # metainit d50 -m d51 d52 metainit: d50: WARNING: This form of metainit is not recommended. The submirrors may not have the same data. Please see ERRORS in metainit(1M) for additional information. d50: Mirror is setup |
This example shows the creation a two-way mirror, d50. The metainit command creates two submirrors (d51 and d52), which are RAID-0 volumes. The metainit -m command is then run with both submirrors to create the mirror. When you create a mirror using the metainit command rather than the metattach command , no resynchronization operations occur. As a result, data could become corrupted when Solaris Volume Manager assumes that both sides of the mirror are identical and can be used interchangeably.
To prepare a newly created mirror for a file system, see Chapter 18, Creating UFS, TMPFS, and LOFS File Systems (Tasks), in System Administration Guide: Devices and File Systems. Some applications, such as a database, do not use a file system. These applications instead use the raw device. The application must have its own way of accessing the raw device.