Use this procedure to mirror the root (/) file system.
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 A, Sun Cluster Object-Oriented Commands, in Sun Cluster System Administration Guide for Solaris OS.
Become superuser.
Place the root slice in a single-slice (one-way) concatenation.
Specify the physical disk name of the root-disk slice (cNtXdYsZ).
phys-schost# metainit -f submirror1 1 1 root-disk-slice |
Create a second concatenation.
phys-schost# metainit submirror2 1 1 submirror-disk-slice |
Create a one-way mirror with one submirror.
phys-schost# metainit mirror -m submirror1 |
If the device is a local device to be used to mount a global-devices file system, /global/.devices/node@nodeid, the volume name for the mirror must be unique throughout the cluster.
Set up the system files for the root (/) directory.
phys-schost# metaroot mirror |
This command edits the /etc/vfstab and /etc/system files so the system can be booted with the root (/) file system on a metadevice or volume. For more information, see the metaroot(1M) man page.
Flush all file systems.
phys-schost# lockfs -fa |
This command flushes all transactions out of the log and writes the transactions to the master file system on all mounted UFS file systems. For more information, see the lockfs(1M) man page.
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 evacuate resource or device groups.
Reboot the node.
This command remounts the newly mirrored root (/) file system.
phys-schost# shutdown -g0 -y -i6 |
Attach the second submirror to the mirror.
phys-schost# metattach mirror submirror2 |
See the metattach(1M) man page for more information.
If the disk that is used to mirror the root disk is physically connected to more than one node (multihosted), modify the device group's properties to support its use as a mirror.
Ensure that the device group meets the following requirements:
The raw-disk device group must have only one node configured in its node list.
The localonly property of the raw-disk device group must be enabled. The localonly property prevents unintentional fencing of a node from its boot device if the boot device is connected to multiple nodes.
If necessary, use the cldevice command to determine the name of the raw-disk device group.
phys-schost# cldevice show node:/dev/rdsk/cNtXdY |
If you issue the command from a node that is physically connected to the disk, you can specify the disk name as cNtXdY instead of by its full device path name.
In the following example, the raw-disk device-group name dsk/d2 is part of the DID device name.
=== DID Device Instances === DID Device Name: /dev/did/rdsk/d2 Full Device Path: phys-schost-1:/dev/rdsk/c1t1d0 Full Device Path: phys-schost-3:/dev/rdsk/c1t1d0 … |
See the cldevice(1CL) man page for more information.
View the node list of the raw-disk device group.
phys-schost# cldevicegroup show dsk/dN |
Output looks similar to the following for the device group dsk/d2:
Device Group Name: dsk/d2 … Node List: phys-schost-1, phys-schost-3 … localonly: false |
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.
phys-schost# cldevicegroup remove-node -n node devicegroup |
Specifies the node to remove from the device-group node list.
Enable the localonly property of the raw-disk device group, if it is not already enabled.
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.
phys-schost# cldevicegroup set -p localonly=true devicegroup |
Sets the value of a device-group property.
Enables the localonly property of the device group.
For more information about the localonly property, see the cldevicegroup(1CL) man page.
Record the alternate boot path for possible future use.
If the primary boot device fails, you can then boot from this alternate boot device. See Special Considerations for Mirroring root (/) in Solaris Volume Manager Administration Guide or Creating a RAID-1 Volume in Solaris Volume Manager Administration Guide for more information about alternate boot devices.
phys-schost# ls -l /dev/rdsk/root-disk-slice |
Repeat Step 1 through Step 11 on each remaining node of the cluster.
Ensure that each volume name for a mirror on which a global-devices file system, /global/.devices/node@nodeid, is to be mounted is unique throughout the cluster.
The following example shows the creation of mirror d0 on the node phys-schost-1, which consists of submirror d10 on partition c0t0d0s0 and submirror d20 on partition c2t2d0s0. Device c2t2d0 is a multihost disk, so the localonly property is enabled. The example also displays the alternate boot path for recording.
phys-schost# metainit -f d10 1 1 c0t0d0s0 d11: Concat/Stripe is setup phys-schost# metainit d20 1 1 c2t2d0s0 d12: Concat/Stripe is setup phys-schost# metainit d0 -m d10 d10: Mirror is setup phys-schost# metaroot d0 phys-schost# lockfs -fa phys-schost# clnode evacuate phys-schost-1 phys-schost# shutdown -g0 -y -i6 phys-schost# metattach d0 d20 d0: Submirror d20 is attached 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# cldevicegroup set -p localonly-true dsk/d2 phys-schost# ls -l /dev/rdsk/c2t2d0s0 lrwxrwxrwx 1 root root 57 Apr 25 20:11 /dev/rdsk/c2t2d0s0 –> ../../devices/node@1/pci@1f,0/pci@1/scsi@3,1/disk@2,0:a,raw |
To mirror the global devices namespace, /global/.devices/node@nodeid, go to How to Mirror the Global Devices Namespace.
To mirror file systems than cannot be unmounted, go to How to Mirror File Systems Other Than Root (/) That Cannot Be Unmounted.
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.