Use this procedure to mirror user-defined file systems that can be unmounted. In this procedure, the nodes do not need to be rebooted.
Become superuser on a node of the cluster.
Unmount the file system to mirror.
Ensure that no processes are running on the file system.
# umount /mount-point |
See the umount(1M) man page and Chapter 19, 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).
# metainit -f submirror1 1 1 diskslice |
Create a second concatenation.
# metainit submirror2 1 1 submirror-diskslice |
Create a one-way mirror with one submirror.
# metainit mirror -m submirror1 |
The metadevice or 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.
# 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.
# 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.
# metastat mirror |
If the disk that is used to mirror the user-defined file system is physically connected to more than one node (multihosted), enable the localonly property.
Perform the following steps to enable the localonly property of the raw-disk device group for the disk that is used to mirror the user-defined file system. You must enable the localonly property to prevent unintentional fencing of a node from its boot device if the boot device is connected to multiple nodes.
If necessary, use the scdidadm -L command to display the full device-ID path name of the raw-disk device group.
In the following example, the raw-disk device-group name dsk/d4 is part of the third column of output, which is the full device-ID path name.
# scdidadm -L … 1 phys-schost-3:/dev/rdsk/c1t1d0 /dev/did/rdsk/d2 |
View the node list of the raw-disk device group.
Output looks similar to the following.
# scconf -pvv | grep dsk/d2 Device group name: dsk/d2 … (dsk/d2) Device group node list: phys-schost-1, phys-schost-3 … |
If the node list contains more than one node name, remove all nodes from the node list except the node whose root disk you mirrored.
Only the node whose root disk you mirrored should remain in the node list for the raw-disk device group.
# scconf -r -D name=dsk/dN,nodelist=node |
Specifies the cluster-unique name of the raw-disk device group
Specifies the name of the node or nodes to remove from the node list
Enable the localonly property.
When the localonly property is enabled, the raw-disk device group is used exclusively by the node in its node list. This usage prevents unintentional fencing of the node from its boot device if the boot device is connected to multiple nodes.
# scconf -c -D name=rawdisk-groupname,localonly=true |
Specifies the name of the raw-disk device group
For more information about the localonly property, see the scconf_dg_rawdisk(1M) man page.
Mount the mirrored file system.
# mount /mount-point |
See the mount(1M) man page and Chapter 19, 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 the localonly property is enabled.
(Unmount the file system) # umount /export (Create the mirror) # metainit -f d14 1 1 c0t0d0s4 d14: Concat/Stripe is setup # metainit d24 1 1 c2t2d0s4 d24: Concat/Stripe is setup # metainit d4 -m d14 d4: Mirror is setup (Edit the /etc/vfstab file) # 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 (Attach the second submirror) # metattach d4 d24 d4: Submirror d24 is attached (View the sync status) # metastat d4 d4: Mirror Submirror 0: d14 State: Okay Submirror 1: d24 State: Resyncing Resync in progress: 15 % done … (Identify the device-ID name of the mirrored disk's raw-disk device group) # scdidadm -L … 1 phys-schost-3:/dev/rdsk/c2t2d0 /dev/did/rdsk/d2 (Display the device-group node list) # scconf -pvv | grep dsk/d2 Device group name: dsk/d2 … (dsk/d2) Device group node list: phys-schost-1, phys-schost-3 … (Remove phys-schost-3 from the node list) # scconf -r -D name=dsk/d2,nodelist=phys-schost-3 (Enable the localonly property) # scconf -c -D name=dsk/d2,localonly=true (Mount the file system) # 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 Creating a Multi-Owner Disk Set in Solaris Volume Manager for Sun Cluster for the Oracle Real Application Clusters Database in Sun Cluster Data Service for Oracle Real Application Clusters Guide for Solaris OS.
To create a disk set for any other application, go to Creating Disk Sets in a Cluster.
If you used SunPlex Installer to install Solstice DiskSuite, one to three disk sets might already exist. See Using SunPlex Installer to Configure Sun Cluster Software for information about the metasets that were created by SunPlex Installer.
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.