Solaris Volume Manager Administration Guide

ProcedureHow to Create a RAID 1 Volume From Unused Slices

Steps
  1. Check Prerequisites for Creating Solaris Volume Manager Components and Background Information for Creating RAID 1 Volumes.

  2. Create two stripes or concatenations, which will be the submirrors.

    See How to Create a RAID 0 (Stripe) Volume or How to Create a RAID 0 (Concatenation) Volume.

  3. 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 instructions on screen. 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
      
      • volume-name is the name of the volume to create.

      • -m specifies to create a mirror.

      • submirror-name 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.

  4. 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 tab and follow the instructions on screen to Attach Submirror. For more information, see the online help.

    • Use the following form of the metattach command:


      metattach mirror-name new-submirror-name
      
      • volume-name is the name of the RAID 1 volume to modify.

      • submirror-name specifies the name of the component that will be the next submirror in the mirror.

      See the following examples and the metattach(1M) man page for more information.


Example 11–1 Creating a Two-Way Mirror


# 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 the creation of a 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.) The system verifies that the objects are defined.



Example 11–2 Creating a Two-Way Mirror Without 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 creates a two-way mirror, d50. The metainit command creates two submirrors (d51 and d52), which are RAID 0 volumes. The metainit -m command with both submirrors creates the mirror from the d51 RAID 0 volume and avoids resynchronization. It is assumed that all information on the mirror is considered invalid and will be regenerated (for example, through a newfs operation) before the mirror is used.


See Also

To prepare a newly created mirror for a file system, see Chapter 16, Creating UFS, TMPFS, and LOFS File Systems (Tasks), in System Administration Guide: Devices and File Systems. An application, such as a database, that uses the raw volume must have its own way of recognizing the volume.