![]() |
![]() |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Chapter 10RAID 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.
Creating a RAID 1 Volume
|
# 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.
# 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.
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 SystemUse 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 a x86 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.
Check Prerequisites for Creating Solaris Volume Manager Elements and Background Information for Creating RAID 1 Volumes.
Identify the slice that contains the existing file system to be mirrored (c1t0d0s0 in this example).
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 |
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 |
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.
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.
Use the metattach command to attach the second submirror.
# metattach d0 d2 |
See the metattach(1M) man page for more information.
If you mirrored your root file system, record the alternate boot path.
Previous Contents Index Next ![]() |