This section describes how to remove mirrors from the system.
Removing a mirror that is used by a file system that cannot be unmounted--such as root (/), swap, /opt, or /usr--essentially involves "unmirroring" the file system and mounting it on the underlying slice of one of the submirrors making up the mirror. Refer to "How to Unmirror a File System That Cannot Be Unmounted (Command Line)".
To remove a mirror and keep the same metadevice name as the mount device, refer to "Metadevice Name Switching".
If you delete a mirror's submirrors and reuse the slices that were part of the deleted submirrors, all of that data is gone from the system. Thus, make sure you back up the data on the mirror before deleting it and its submirrors.
When removing a mirror, you first "break apart" the mirror into its submirrors. You can choose to keep the data on one of the submirrors, or if a submirror consists of a single slice, you can keep the data on the slice.
You can use this task for any file system or non-UFS application that uses a mirror, except for a file system that is root (/), swap, /opt, or /usr. To remove a mirror that is used by one of these file systems, refer to "How to Unmirror a File System That Cannot Be Unmounted (Command Line)".
Make sure you have met the prerequisites ("Prerequisites for Removing DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Removing Mirrors").
Make sure you have a current backup of the metadevice.
Stop access to the metadevice.
For example, a mirrored file system should be unmounted. For a non-UFS application, such as a database, perform the steps necessary to stop the application's use of the metadevice.
Double-click the Mirror object in the Objects list.
The mirror object appears on the canvas.
Display the Mirror object's pop-up menu and choose Delete.
Click the Really Delete button.
The mirror is split into its underlying submirrors (Concat/Stripe metadevices).
[Optional] If the mirror was used as a file system and there was an entry for the mirror in the etc/vfstab file, use one of the following to clean up the entry for the mirror.
You change the /etc/vfstab entry to mount the file system on one of the submirrors.
If one of the submirrors consists of a one-way concatenation, you can change the /etc/vfstab entry to mount the file system on the underlying slice.
If you do not plan on accessing the data anymore, you can remove the /etc/vfstab entry for the file system altogether.
Clean up the Concat/Stripe objects.
You should delete the submirror metadevice(s) that you no longer need.
To verify that the objects were deleted, display the Configuration Log.
You can use this task for any file system or non-UFS application that uses a mirror, except for a file system that is root (/), swap, /opt, or /usr. To remove a mirror that is used by one of these file systems, refer to "How to Unmirror a File System That Cannot Be Unmounted (Command Line)".
The high-level steps for this procedure are:
Unmounting the file system
Running metadetach(1M) on the mirror and one of its submirrors
Running metaclear(1M) on the mirror
Optional: Editing the /etc/vfstab file to use a non-mirror device, if a file system entry appears here
Optional: Remounting the file system
After checking the prerequisites ("Prerequisites for Removing DiskSuite Objects"), and the preliminary information ("Preliminary Information for Removing Mirrors"), use the metadetach(1M) and metaclear(1M) commands to delete the metadevice. Refer to the metadetach(1M) and metaclear(1M) man pages for more information.
# metastat d2 d2: Mirror Submirror 0: d0 State: Okay Submirror 1: d1 State: Okay ... # umount /news # metadetach d2 d0 # metaclear d2 d2: Mirror is cleared (Edit the /etc/vfstab file so that /news references submirror d0) # mount /news # metaclear d1 d1: Concat/Stripe is cleared |
This example clears the mirror d2 that also contains a mounted file system. The mirror consists of submirrors d0 and d1. The metastat command reports that both submirrors are in the "Okay" state. The file system must be unmounted before the metadetach command detaches submirror d0 from mirror d2. The mirror is then cleared.
To continue to access data on submirror d0, the entry for the file system in the /etc/vfstab file is changed from the mirror to the concatenation (submirror) d0.
After cleaning up the /etc/vfstab file to reference submirror (concatenation) d0, the file system is remounted. (It is remounted on d0.) The other submirror, d1, is cleared with the metaclear command.