This section describes maintenance tasks that you perform on mirrors, including unmirroring a file system, attaching and detaching submirrors, and offlining and onlining submirrors.
Unmirroring - DiskSuite Tool does not support unmirroring root (/), /opt, /usr, or swap, or any other file system that cannot be unmounted while the system is running. Instead, use the command line procedure for these file systems.
Attaching - You can attach a submirror to a mirror without interrupting service. You attach submirrors to mirrors to create two- and three-way mirrors.
Detach vs. Offline - When you place a submirror offline, you prevent the mirror from reading from and writing to the submirror, but you preserve the submirror's logical association to the mirror. While the submirror is offline, DiskSuite keeps track of all writes to the mirror and they are written to the submirror when it is brought back online. By performing an optimized resync, DiskSuite only has to resync data that has changed, not the entire submirror. When you detach a submirror, you sever its logical association to the mirror. Typically you place a submirror offline to perform maintenance; you detach a submirror to remove it.
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)".
Make sure you have met the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Mirrors").
Check that the status of at least one submirror is "OK."
A mirror with no submirrors in the "OK" state must be repaired first.
Unmount the file system.
Double-click the Mirror object in the Objects list.
The object appears on the canvas.
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.
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.
[Optional] If retain access to the data, mount the file system.
When the file system is remounted, it is on the stripe or concatenation.
[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.
[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.
To verify that the mirror was deleted, display the Configuration Log.
[Optional] Select Rescan Configuration from the File menu to reflect the file system's new mount device.
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:
Running the metastat(1M) command to verify that at least one submirror is in the "Okay" state
Unmounting the file system
Running the metadetach(1M) command on the submirror that will continue to be used for the file system
Editing the /etc/vfstab file to use a nonmirror device, if the file system entry appears here
Remounting the 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.
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.
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:
Running the metastat(1M) command to verify that at least one submirror is in the "Okay" state
Running the metadetach(1M) command on the mirror that contains root (/), /usr, /opt, or swap to make a one-way mirror
For /usr, /opt, and swap: changing the file system entry in the /etc/vfstab file to use a non-DiskSuite device (slice)
For root (/) only: running the metaroot(1M) command
Rebooting the system
Running the metaclear(1M) command to clear the mirror and submirrors
# 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.
# 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.
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".
Make sure you have met the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Mirrors").
Double-click an existing Mirror object in the Objects list and verify that its status is "OK."
The object appears on the canvas.
Drag the Concat/Stripe object to be attached to the mirror to the top of the Mirror object.
Click the top rectangle of the Mirror object then click Commit.
A resync of the new submirror is initiated.
To verify that the mirror was committed, display the Configuration Log.
This example shows a a mirror, d2, to which a submirror, d7 has been attached. The mirror automatically syncs the data on new submirror.
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".
# 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.
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.
Make sure you have met the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Mirrors").
Double-click the Mirror object in the Objects list.
The object appears on the canvas.
Click inside the submirror to be detached.
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."
Click the top rectangle of the Mirror object then click Commit.
To verify that the mirror was committed, display the Configuration Log.
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.
# 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.
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.
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.
Make sure you have met the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Mirrors").
Double-click an existing Mirror object in the Objects list.
The object appears on the canvas.
Display the Mirror object's pop-up window and select Info.
The Mirror Information window appears.
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)."
Click Close.
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.
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.
# 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.
# 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.
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.