Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 10

RAID 1 (Mirror) Volumes (Tasks)

This chapter explains how to perform Solaris Volume Manager tasks related to RAID 1 volumes. For information about related concepts, see Chapter 9, RAID 1 (Mirror) Volumes (Overview).

RAID 1 Volumes (Task Map)

The following task map identifies the procedures needed to manage Solaris Volume Manager RAID 1 volumes.

Task

Description

Instructions

Create a mirror from unused slices Use the Solaris Volume Manager GUI or the metainit command to create a mirror from unused slices."How to Create a RAID 1 Volume From Unused Slices"
Create a mirror from an existing file system Use the Solaris Volume Manager GUI or the metainit command to create a mirror from an existing file system.

"How to Create a RAID 1 Volume From a File System"

Record the path to the alternate boot device for a mirrored root Find the path to the alternative book device and enter it in the boot instructions.  "How to Record the Path to the Alternate Boot Device"

Attach a submirror

Use the Solaris Volume Manager GUI or the metattach command to attach a submirror.

"How to Attach a Submirror"

Detach a submirror

Use the Solaris Volume Manager GUI or the metadetach command to detach the submirror.

"How to Detach a Submirror"

Place a submirror online or take a submirror offline

Use the Solaris Volume Manager GUI or the metaonline command to put a submirror online. Use the Solaris Volume Manager GUI or the metaoffline command to take a submirror offline..

"How to Place a Submirror Offline and Online"

Enable a component within a submirror

Use the Solaris Volume Manager GUI or the metareplace command to enable a slice in a submirror.

"How to Enable a Slice in a Submirror"

Check mirror status

Use the Solaris Volume Manager GUI or the metastat command to check the status of RAID 1 volumes.

"How to Check the Status of Mirrors and Submirrors"

Change mirror options

Use the Solaris Volume Manager GUI or the metaparam command to change the options for a specific RAID 1 volume.

"How to Change RAID 1 Volume Options"

Expand a mirror

Use the Solaris Volume Manager GUI or the metattach command to expand the capacity of a mirror.

"How to Expand a RAID 1 Volume"

Replace a slice within a submirror

Use the Solaris Volume Manager GUI or the metareplace command to replace a slice in a submirror.

"How to Replace a Slice in a Submirror"

Replace a submirror

Use the Solaris Volume Manager GUI or the metattach command to replace a submirror.

"How to Replace a Submirror"

Remove a mirror (unmirror)

Use the Solaris Volume Manager GUI or the metadetach command or the metaclear command to unmirror a file system.

"How to Unmirror a File System"

Remove a mirror (unmirror) of a file system that cannot be unmounted

Use the Solaris Volume Manager GUI or the metadetach command or the metaclear command to unmirror a file system that cannot be unmounted.

"How to Unmirror a File System That Cannot Be Unmounted"

Use a mirror to perform backups

Use the Solaris Volume Manager GUI or the metaonline command and the metaoffline commands to perform backups with mirrors.

"How to Use a RAID 1 Volume to Make an Online Backup"

Creating a RAID 1 Volume

How to Create a RAID 1 Volume From Unused Slices

  1. Check "Prerequisites for Creating Solaris Volume Manager Elements" 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--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--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.

Where to Go From Here

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

How to Create a RAID 1 Volume From a File System

Use this procedure to mirror an existing file system. If the file system can be unmounted, the entire procedure can be completed without a reboot. For file systems (such as root (/)) that cannot be unmounted, the system will have to be rebooted to complete the procedure.


Note - When mirroring root (/), it is essential that you record the secondary root slice name to reboot the system if the primary submirror fails. This information should be written down, not recorded on the system, which might not be available. See Chapter 24, Troubleshooting Solaris Volume Manager for details on recording the alternate boot device, and on booting from the alternate boot device.

If you are mirroring root on an IA system, install the boot information on the alternate boot disk before you create the RAID 0 or RAID 1 devices. See "SPARC: Booting a System (Tasks)" in System Administration Guide: Basic Administration.


In this procedure, an existing device is c1t0d0s0. A second device, c1t1d0s0, is available for the second half of the mirror. The submirrors will be d1 and d2, respectively, and the mirror will be d0.

  1. Check "Prerequisites for Creating Solaris Volume Manager Elements" and "Background Information for Creating RAID 1 Volumes".

  2. Identify the slice that contains the existing file system to be mirrored (c1t0d0s0 in this example).

  3. Create a new RAID 0 volume on the slice from the previous step by using 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 metainit raid-0-volume-name -f 1 1 ctds-of-slice command.

      # metainit d1 -f 1 1 c1t0d0s0
  4. Create a second RAID 0 volume (concatenation) on an unused slice (c1t1d0s0 in this example) to act as the second submirror. The second submirror must be the same size as the original submirror or larger. 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 metainit second-raid-0-volume-name 1 1 ctds-of-slice command.

      # metainit d2 1 1 c1t1d0s0
  5. Create a one-way mirror by using 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 metainit mirror-name -m raid-0-volume-name command.

      # metainit d0 -m d1

    See the metainit(1M) man page for more information.


    Note - When you create a mirror from an existing file system, you must follow the next two steps precisely to avoid data corruption.


    If you are mirroring any file system other than the root (/) file system, then edit the /etc/vfstab file so that the file system mount instructions refer to the mirror, not to the block device.

    For more information about the/etc/vfstab file, see"Mounting File Systems ()" in System Administration Guide: Basic Administration.

  6. Remount your newly mirrored file system according to one of the following procedures:

    • If you are mirroring your root (/) file system, run the metaroot d0 command, replacing d0 with the name of the mirror you just created, then reboot your system.

      For more information, see the metaroot(1M) man page.

    • If you are mirroring a file system that can be unmounted, then unmount and remount the file system.

    • If you are mirroring a file system other than root (/) that cannot be unmounted, then reboot your system.

  7. Use the metattach command to attach the second submirror.

    # metattach d0 d2

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

  8. If you mirrored your root file system, record the alternate boot path.

    See "How to Record the Path to the Alternate Boot Device".


Caution - Be sure to create a one-way mirror with the metainit command then attach the additional submirrors with the metattach command. When the metattach command is not used, 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 interchangably.


 
 
 
  Previous   Contents   Next