Solstice DiskSuite 4.2.1 User's Guide

Working With Mirrors

This section describes maintenance tasks that you perform on mirrors, including unmirroring a file system, attaching and detaching submirrors, and offlining and onlining submirrors.

Preliminary Information for Mirrors

How to Unmirror a File System (DiskSuite Tool)

Use this procedure to unmirror a file system that can be unmounted while the system is running. To unmirror root (/), /opt, /usr, or swap, or any other file system that cannot be unmounted while the system is running, refer to "How to Unmirror a File System That Cannot Be Unmounted (Command Line)".

  1. Make sure you have met the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Mirrors").

  2. Check that the status of at least one submirror is "OK."

    A mirror with no submirrors in the "OK" state must be repaired first.

  3. Unmount the file system.

  4. Double-click the Mirror object in the Objects list.

    The object appears on the canvas.

  5. To delete the mirror, display the mirror's pull-down menu and choose the Delete option. Click the Really Delete button on the Confirmation dialog box that appears.

    The mirror is split into its constituent submirrors, which appear on the canvas.

  6. Edit the /etc/vfstab file.

    You must change the device name for the file system. To retain access to the data, change from the mirror to one of the submirrors. (The submirror is either a stripe or concatenated metadevice.) To remove access to the data, completely remove the entry for the file system.

  7. [Optional] If retain access to the data, mount the file system.

    When the file system is remounted, it is on the stripe or concatenation.

  8. [Optional] To delete the submirror that is not in use, choose the Delete option from the submirror's pull-down menu.

    Be sure to choose the submirror that you will not be using.

  9. [Optional] If the submirror is composed of a single slice, you can mount the file system on the slice. To do so, delete the stripe or concatenation. Then edit the /etc/vfstab file to mount the file system on the physical slice instead of the metadevice.

  10. To verify that the mirror was deleted, display the Configuration Log.

  11. [Optional] Select Rescan Configuration from the File menu to reflect the file system's new mount device.

How to Unmirror a File System (Command Line)

Use this procedure to unmirror a file system that can be unmounted while the system is running. To unmirror root (/), /opt, /usr, or swap, or any other file system that cannot be unmounted while the system is running. use the command line procedure on "How to Unmirror a File System That Cannot Be Unmounted (Command Line)".

After checking the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and the preliminary information ("Preliminary Information for Mirrors"), use the metadetach(1M) and metaclear(1M) commands to unmirror a file system. For more information refer to the metadetach(1M) and metaclear(1M) man pages.

The high-level steps to unmirror a mirror are:

Example -- Unmirroring the /var File System


# metastat d4
d4: Mirror
    Submirror 0: d2
      State: Okay        
    Submirror 1: d3
      State: Okay        
...
# umount /var
# metadetach d4 d2
d4: submirror d2 is detached
# metaclear -r d4
d4: Mirror is cleared
d3: Concat/Stripe is cleared
(Edit the /etc/vfstab file so that the entry for /var is changed from d4 to d2)
# mount /var

/var is made of a two-way mirror named d4; its submirrors are d2 and d3, made of slices /dev/dsk/c0t0d0s0 and /dev/dsk/c1t0d0s0, respectively. The metastat(1M) command verifies that at least one submirror is in the "Okay" state. (A mirror with no submirrors in the "Okay" state must be repaired first.) The file system is unmounted then submirror d2 is detached. The metaclear -r command deletes the mirror and the other submirror, d3.

Next, the entry for /var in the /etc/vfstab file is changed to reference the submirror. For example, if d4 were the mirror and d2 the submirror, the following line:


/dev/md/dsk/d4  /dev/md/rdsk/d4  /var ufs  2  yes -

should be changed to:


/dev/md/dsk/d2  /dev/md/rdsk/d2  /var ufs  2  yes -

By using the submirror name, you can continue to have the file system mounted on a metadevice. Lastly, /var is remounted.


Note -

By using d2 instead of d4 in the /etc/vfstab file, you have unmirrored the mirror. Because d2 consists of a single slice, you can mount the file system on the slice name (/dev/dsk/c0t0d0s0) if you do not want the device to support a metadevice.


How to Unmirror a File System That Cannot Be Unmounted (Command Line)

Use this task to unmirror file systems that cannot be unmounted during normal system operation, including root (/), /usr, /opt, and swap.

The high-level steps for this procedure are:

Example -- Unmirroring root (/)


# metadetach d0 d20
d0: submirror d20 is detached
# metaroot /dev/dsk/c0t3d0s0
# reboot
...
# metaclear -r d0
d0: Mirror is cleared
d10: Concat/Stripe is cleared
# metaclear d20
d20: Concat/Stripe is cleared

In this example, root (/) is a two-way mirror named d0; its submirrors are d10 and d20, which are made of slices /dev/dsk/c0t3d0s0 and /dev/dsk/c1t3d0s0, respectively. The metastat command verifies that at least one submirror is in the "Okay" state. (A mirror with no submirrors in the "Okay" state must first be repaired.) Submirror d20 is detached to make d0 a one-way mirror. The metaroot command is then run, using the rootslice that the system is going to boot from. This edits the /etc/system and /etc/vfstab files to remove information specifying the mirroring of root (/). After a reboot, the metaclear -r command deletes the mirror and the other submirror, d10. The last metaclear command clears submirrror d20.

Example -- Unmirroring swap


# metastat d1
d1: Mirror
    Submirror 0: d11
      State: Okay        
    Submirror 1: d21
      State: Okay        
...
# metadetach d1 d21
d1: submirror d21 is detached
(Edit the /etc/vfstab file to change the entry for swap from metadevice to slice name)
# reboot
...
# metaclear -r d1
d1: Mirror is cleared
d11: Concat/Stripe is cleared
# metaclear d21
d21: Concat/stripe is cleared

In this example, swap is made of a two-way mirror named d1; its submirrors are d11 and d21, which are made of slices /dev/dsk/c0t3d0s1 and /dev/dsk/c1t3d0s1, respectively. The metastat command verifies that at least one submirror is in the "Okay" state. (A mirror with no submirrors in the "Okay" state must first be repaired.) Submirror d21 is detached to make d1 a one-way mirror. Next, the /etc/vfstab file must be edited to change the entry for swap to reference the slice that is in submirror d21. For example, if d1 was the mirror, and d21 the submirror containing slice /dev/dsk/c0t3d0s1, the following line:


/dev/md/dsk/d1 - - swap - no -

should be changed to:


/dev/dsk/c0t3d0s1 - - swap - no -

After a reboot, the metaclear -r command deletes the mirror and the other submirror, d11. The final metaclear command clears submirrror d21.

How to Attach a Submirror (DiskSuite Tool)

Before starting, identify the concatenation or stripe to be used as the submirror. It must be the same size (or larger) as the existing submirror in the mirror. If you have not yet created either, refer "Creating Stripes and Concatenations".

  1. Make sure you have met the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Mirrors").

  2. Double-click an existing Mirror object in the Objects list and verify that its status is "OK."

    The object appears on the canvas.

  3. Drag the Concat/Stripe object to be attached to the mirror to the top of the Mirror object.

  4. Click the top rectangle of the Mirror object then click Commit.

    A resync of the new submirror is initiated.

  5. To verify that the mirror was committed, display the Configuration Log.

Example -- Mirror Object With Attached Submirror

This example shows a a mirror, d2, to which a submirror, d7 has been attached. The mirror automatically syncs the data on new submirror.

Graphic

How to Attach a Submirror (Command Line)

After checking the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and the preliminary information ("Preliminary Information for Mirrors"), use the metattach(1M) command to attach a submirror to a mirror. Refer to the metattach(1M) man page for more information.

Before starting, identify the concatenation or stripe to be used as the submirror. It must be the same size (or larger) as the existing submirror in the mirror. If you have not yet created either, refer "Creating Stripes and Concatenations".

Example -- Attaching a Submirror


# metastat d30
d30: mirror
    Submirror 0: d60
      State: Okay   
...
# metattach d30 d70
d30: submirror d70 is attached
# metastat d30
d30: mirror
    Submirror 0: d60
      State: Okay        
    Submirror 1: d70
      State: Resyncing
    Resync in progress: 41 % done
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 2006130 blocks
...

This example shows the attaching of a submirror, d70, to a one-way mirror, d30, creating a two-way mirror. The mirror d30 initially consists of submirror d60. d70 is a concatenated metadevice. You verify that the status of the mirror is "Okay" with the metastat(1M) command, then attach the submirror. When the metattach(1M) command is run, the new submirror is resynced with the existing mirror. When you attach an additional submirror to the mirror, the system displays a message. To verify that the mirror is resyncing, use the metastat(1M) command.

How to Detach a Submirror (DiskSuite Tool)

You might want to detach a submirror if you were going to reuse the underlying disks. You can detach that submirror without disrupting service from the system.

  1. Make sure you have met the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Mirrors").

  2. Double-click the Mirror object in the Objects list.

    The object appears on the canvas.

  3. Click inside the submirror to be detached.

  4. Drag the submirror out of the Mirror object to the canvas.

    If this is a two-way mirror, the mirror's status changes to "Urgent."

  5. Click the top rectangle of the Mirror object then click Commit.

  6. To verify that the mirror was committed, display the Configuration Log.

How to Detach a Submirror (Command Line)

After checking the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and the preliminary information ("Preliminary Information for Mirrors"), use the metadetach(1M) command to detach a submirror from a mirror. Refer to the metadetach(1M) man page for more information.

Example -- Detaching a Submirror


# metastat
d5: mirror
    Submirror 0: d50
...
# metadetach d5 d50
d5: submirror d50 is detached

In this example, mirror d5 has a submirror, d50, which is detached with the metadetach(1M) command. The underlying slices from d50 are going to be reused elsewhere. When you detach a submirror from a mirror, the system displays a confirmation message.

How to Place a Submirror Offline and Online (DiskSuite Tool)

Placing a submirror offline and online is useful when repairing physical disks. For example, if a disk in a SCSI chain fails, all other metadevices in the chain could be taken offline while the broken disk is replaced. Metadevices are brought online after the replacement disk is installed.

When you take a submirror offline, DiskSuite keeps track of all I/O to the mirror. When you bring the submirror back online, DiskSuite performs an optimized resync of the data, and only has to resync changes, not the entire submirrror.


Note -

A submirror that has been taken offline can only be mounted read-only.


The steps to place a submirror offline and online are essentially the same.

  1. Make sure you have met the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Mirrors").

  2. Double-click an existing Mirror object in the Objects list.

    The object appears on the canvas.

  3. Display the Mirror object's pop-up window and select Info.

    The Mirror Information window appears.

    Graphic
  4. Select the submirror in the device list.

  5. If the submirror is offline, click Online. If the submirror is online, click Offline.

    The status of the submirror changes to "Offline (Scheduled)," or "Online (Scheduled)."

  6. Click Close.

  7. Click the top rectangle of the Mirror object then click Commit.

    If you are bringing a mirror offline, the mirror status changes to "Offline." If you are bringing a mirror online, DiskSuite starts a resync operation.

How to Place a Submirror Offline and Online (Command Line)

After checking the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and the preliminary information ("Preliminary Information for Mirrors"), use the metaoffline(1M) command to offline a submirror, or the metaonline(1M) command to online a submirror. Refer to the metaoffline(1M)or metaonline(1M)man pages for more information.

Example -- Placing a Submirror Offline


# metaoffline d10 d11
d10: submirror d11 is offlined

This takes submirror d11 offline from mirror d10. Reads will continue to be made from the other submirror. The mirror will be out of sync as soon as the first write is made. This inconsistency is corrected when the offlined submirror is brought back online.

Example -- Placing a Submirror Online


# metaonline d10 d11
d10: submirror d11 is onlined

When ready (for example, after replacing a disk), the submirror d11 is brought back online.

The metaonline(1M) command can only be used when a submirror was taken offline by the metaoffline(1M) command. After the metaonline(1M) command runs, DiskSuite automatically begins resyncing the submirror with the mirror.


Note -

The metaoffline(1M) command's functionality is similar to that offered by metadetach(1M) however metaoffline(1M) does not sever the logical association between the submirror and the mirror.