Sun Cluster Software Installation Guide for Solaris OS

ProcedureHow to Mirror File Systems Other Than Root (/) That Cannot Be Unmounted

Use this procedure to mirror file systems other than root (/) that cannot be unmounted during normal system usage, such as /usr, /opt, or swap.

  1. Become superuser.

  2. Place the slice on which an unmountable file system resides in a single-slice (one-way) concatenation.

    Specify the physical disk name of the disk slice (cNtX dYsZ).

    phys-schost# metainit -f submirror1 1 1 diskslice
  3. Create a second concatenation.

    phys-schost# metainit submirror2 1 1 submirror-diskslice
  4. Create a one-way mirror with one submirror.

    phys-schost# metainit mirror -m submirror1

    Note –

    The volume name for this mirror does not need to be unique throughout the cluster.

  5. Repeat Step 1 through Step 4 for each remaining unmountable file system that you want to mirror.

  6. On each node, edit the /etc/vfstab file entry for each unmountable file system you mirrored.

    Replace the names in the device to mount and device to fsck columns with the mirror name.

    phys-schost# vi /etc/vfstab
    #device        device        mount    FS     fsck    mount    mount
    #to mount      to fsck       point    type   pass    at boot  options
    /dev/md/dsk/mirror /dev/md/rdsk/mirror /filesystem ufs 2 no global
  7. Move any resource groups or device groups from the node.

    phys-schost# clnode evacuate from-node

    Specifies the name of the node from which to move resource or device groups.

  8. Reboot the node.

    phys-schost# shutdown -g0 -y -i6
  9. Attach the second submirror to each mirror.

    This attachment starts a synchronization of the submirrors.

    phys-schost# metattach mirror submirror2
  10. Wait for the synchronization of the mirrors, started in Step 9, to complete.

    Use the metastat(1M) command to view mirror status and to verify that mirror synchronization is complete.

    phys-schost# metastat mirror
  11. If the disk that is used to mirror the unmountable file system is physically connected to more than one node (multihosted), disable fencing for that disk.

    Disabling fencing for the device prevents unintentional fencing of a node from its boot device if the boot device is connected to multiple nodes.

    phys-schost# cldevice set -p default_fencing=nofencing submirror-disk

    Specifies a device property.


    Disables fencing for the specified device.

    For more information about the default_fencing property, see the cldevice(1CL) man page.

Example 4–4 Mirroring File Systems That Cannot Be Unmounted

The following example shows the creation of mirror d1 on the node phys-schost-1 to mirror /usr, which resides on c0t0d0s1. Mirror d1 consists of submirror d11 on partition c0t0d0s1 and submirror d21 on partition c2t2d0s1. The /etc/vfstab file entry for /usr is updated to use the mirror name d1. Device c2t2d0 is a multihost disk, so fencing is disabled.

phys-schost# metainit -f d11 1 1 c0t0d0s1
d11: Concat/Stripe is setup
phys-schost# metainit d21 1 1 c2t2d0s1
d21: Concat/Stripe is setup
phys-schost# metainit d1 -m d11
d1: Mirror is setup
phys-schost# vi /etc/vfstab
#device        device        mount    FS     fsck    mount    mount
#to mount      to fsck       point    type   pass    at boot  options
/dev/md/dsk/d1 /dev/md/rdsk/d1 /usr ufs  2       no global
phys-schost# clnode evacuate phys-schost-1
phys-schost# shutdown -g0 -y -i6
phys-schost# metattach d1 d21
d1: Submirror d21 is attached
phys-schost# metastat d1
d1: Mirror
      Submirror 0: d11
         State: Okay
      Submirror 1: d21
         State: Resyncing
      Resync in progress: 15 % done
phys-schost# cldevice show phys-schost-3:/dev/rdsk/c2t2d0
DID Device Name:                                /dev/did/rdsk/d2
phys-schost# cldevicegroup show dsk/d2
Device Group Name:                              dsk/d2
  Node List:                                      phys-schost-1, phys-schost-3
  localonly:                                      false
phys-schost# cldevicegroup remove-node -n phys-schost-3 dsk/d2
phys-schost# cldevice set -p default_fencing=nofencing c2t2d0

Next Steps

To mirror user-defined file systems, go to How to Mirror File Systems That Can Be Unmounted.

Otherwise, go to Creating Disk Sets in a Cluster to create a disk set.


Some of the steps in this mirroring procedure might cause an error message similar to metainit: dg-schost-1: d1s0: not a metadevice. Such an error message is harmless and can be ignored.