Solaris Volume Manager Administration Guide

Removing RAID 1 Volumes (Unmirroring)

How to Unmirror a File System

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

  1. Make sure that you have root privilege and that you have a current backup of all data.

  2. Read Background Information for RAID 1 Volumes.

  3. Verify that at least one submirror is in the Okay state.


    # metastat
    
  4. Unmount the file system.


    # umount /home
    
  5. Detach the submirror that will continue to be used for the file system

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


    # metadetach d1 d10
    
  6. Clear the mirror and remaining subcomponents.

    For more information, see the metaclear(1M)


    # metaclear -r d1
    
  7. Edit the /etc/vfstab file to use the component detached in Step 5, if necessary.

  8. Remount the file system.

Example—Unmirroring the /opt File System


# metastat d4
d4: Mirror
    Submirror 0: d2
      State: Okay        
    Submirror 1: d3
      State: Okay        
...
# umount /opt
# 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 /opt is changed 
from d4 to the underlying slice or volume)
# mount /opt

In this example, the /opt filesystem 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 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 /opt in the /etc/vfstab file is changed to reference the underlying slice. For example, if d4 were the mirror and d2 the submirror, the following line:


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

should be changed to:


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

By using the submirror name, you can continue to have the file system mounted on a volume. Finally, the /opt file system 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 volume.

How to Unmirror a File System That Cannot Be Unmounted

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

  1. Run the metastat command to verify that at least one submirror is in the “Okay” state.

  2. Run the metadetach command on the mirror that contains root (/), /usr, /opt, or swap to make a one-way mirror.

  3. For /usr, /opt, and swap: change the file system entry in the /etc/vfstab file to use a non-Solaris Volume Manager device (slice).

  4. For root (/) only: running the metaroot command.

  5. Reboot the system.

  6. Run the metaclear command to clear the mirror and submirrors.

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 from which the system is going to boot. This command edits the /etc/system and /etc/vfstab files to remove information that specifies the mirroring of root (/). After a reboot, the metaclear -r command deletes the mirror and the other submirror, d10. The last metaclear command clears submirror 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 submirror d21.