Use this procedure to mirror file systems other than root (/) that cannot be unmounted during normal system usage, such as /usr, /opt, or swap.
Become superuser on a node of the cluster.
Put 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 (cNtXdYsZ).
# 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 4 for each remaining unmountable file system that you want to mirror.
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.
# 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 |
Move any resource groups or device groups from the node.
# scswitch -S -h from-node |
Moves all resource groups and device groups
Specifies the name of the node from which to move resource or device groups
Reboot the node.
# shutdown -g0 -y -i6 |
Attach the second submirror to each mirror.
This attachment starts a synchronization of the submirrors.
# metattach mirror submirror2 |
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.
# metastat mirror |
Is the disk that is used to mirror the unmountable file system physically connected to more than one node (multiported)?
If no, proceed to Step 12.
If yes, perform the following steps to enable the localonly property of the raw-disk device group for the disk used to mirror the unmountable 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/d2 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 … |
Does the node list contain more than one node name?
Remove all nodes from the node list for the raw-disk device group except the node whose root disk is mirrored.
Only the node whose root disk is mirrored should remain in the node list.
# 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
Use the scconf(1M) command to 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.
Do you intend to mirror user-defined file systems?
If yes, go to How to Mirror File Systems That Can Be Unmounted.
If no, go to How to Create a Diskset to create a diskset.
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. Disk c2t2d0 is a multiported disk, so the localonly property is enabled.
(Create the mirror) # metainit -f d11 1 1 c0t0d0s1 d11: Concat/Stripe is setup # metainit d21 1 1 c2t2d0s1 d21: Concat/Stripe is setup # metainit d1 -m d11 d1: 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/d1 /dev/md/rdsk/d1 /usr ufs 2 no global (Move resource groups and device groups from phys-schost-1) # scswitch -S -h phys-schost-1 (Reboot the node) # shutdown -g0 -y -i6 (Attach the second submirror) # metattach d1 d21 d1: Submirror d21 is attached (View the sync status) # metastat d1 d1: Mirror Submirror 0: d11 State: Okay Submirror 1: d21 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 |