Use this procedure to mirror user-defined file systems that can be unmounted. In this procedure, the nodes do not need to be rebooted.
This procedure provides the long forms of the Sun Cluster commands. Most commands also have short forms. Except for the forms of the command names, the commands are identical. For a list of the commands and their short forms, see Appendix B, Sun Cluster Object-Oriented Commands, in Sun Cluster System Administration Guide for Solaris OS.
Become superuser.
Unmount the file system to mirror.
Ensure that no processes are running on the file system.
phys-schost# umount /mount-point |
See the umount(1M) man page and Chapter 18, Mounting and Unmounting File Systems (Tasks), in System Administration Guide: Devices and File Systems for more information.
Place in a single-slice (one-way) concatenation the slice that contains a user-defined file system that can be unmounted.
Specify the physical disk name of the disk slice (cNtX dYsZ).
phys-schost# metainit -f submirror1 1 1 diskslice |
Create a second concatenation.
phys-schost# metainit submirror2 1 1 submirror-diskslice |
Create a one-way mirror with one submirror.
phys-schost# metainit mirror -m submirror1 |
The volume name for this mirror does not need to be unique throughout the cluster.
Repeat Step 1 through Step 5 for each mountable file system to be mirrored.
On each node, edit the /etc/vfstab file entry for each 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 |
Attach the second submirror to the mirror.
This attachment starts a synchronization of the submirrors.
phys-schost# metattach mirror submirror2 |
Wait for the synchronization of the mirrors, started in Step 8, to be completed.
Use the metastat(1M) command to view mirror status.
phys-schost# metastat mirror |
If the disk that is used to mirror the user-defined 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.
Mount the mirrored file system.
phys-schost# mount /mount-point |
See the mount(1M) man page and Chapter 18, Mounting and Unmounting File Systems (Tasks), in System Administration Guide: Devices and File Systems for more information.
The following example shows creation of mirror d4 to mirror /export, which resides on c0t0d0s4. Mirror d4 consists of submirror d14 on partition c0t0d0s4 and submirror d24 on partition c2t2d0s4. The /etc/vfstab file entry for /export is updated to use the mirror name d4. Device c2t2d0 is a multihost disk, so fencing is disabled.
phys-schost# umount /export phys-schost# metainit -f d14 1 1 c0t0d0s4 d14: Concat/Stripe is setup phys-schost# metainit d24 1 1 c2t2d0s4 d24: Concat/Stripe is setup phys-schost# metainit d4 -m d14 d4: 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/d4 /dev/md/rdsk/d4 /export ufs 2 no global phys-schost# metattach d4 d24 d4: Submirror d24 is attached phys-schost# metastat d4 d4: Mirror Submirror 0: d14 State: Okay Submirror 1: d24 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-2 … localonly: false phys-schost# cldevicegroup remove-node -n phys-schost-3 dsk/d2 phys-schost# cldevice set -p default_fencing=nofencing c2t2d0 phys-schost# mount /export |
If you need to create disk sets, go to one of the following:
To create a Solaris Volume Manager for Sun Cluster disk set for use by Oracle Real Application Clusters, go to How to Create a Multi-Owner Disk Set in Solaris Volume Manager for Sun Cluster for the Oracle RAC Database in Sun Cluster Data Service for Oracle RAC Guide for Solaris OS.
To create a disk set for any other application, go to Creating Disk Sets in a Cluster.
If you have sufficient disk sets for your needs, go to one of the following:
If your cluster contains disk sets that are configured with exactly two disk enclosures and two nodes, you must add dual-string mediators. Go to Configuring Dual-String Mediators.
If your cluster configuration does not require dual-string mediators, go to How to Create Cluster File Systems.
Some of the steps in this mirroring procedure might cause an error message that is similar to metainit: dg-schost-1: d1s0: not a metadevice. Such an error message is harmless and can be ignored.