This section describes how to use the md.tab file to configure metadevices and hot spare pools. Note that with Solstice DiskSuite 4.2, the md.tab file is located in /etc/opt/SUNWmd. With Solstice DiskSuite 4.2.1, the md.tab file is located in /etc/lvm.
If you have an existing md.tab file and want to convert it to use disk IDs, you can use the script in "DID Conversion Script", to help with the conversion.
The md.tab file can be used by the metainit(1M) command to configure metadevices and hot spare pools in a batch-like mode. Solstice DiskSuite does not store configuration information in the md.tab file. The only way information appears in the md.tab is through editing it by hand.
When using the md.tab file, each metadevice or hot spare pool in the file must have a unique entry. Entries can include simple metadevices (stripes, concatenations, and concatenations of stripes); mirrors, trans metadevices, and RAID5 metadevices; and hot spare pools.
Because md.tab only contains entries that are manually included in it, you should not rely on the file for the current configuration of metadevices, hot spare pools, and replicas on the system at any given time.
Tabs, spaces, comments (preceded by a pound sign, #), and continuation of lines (preceded by a backslash-newline), are allowed.
With Solstice DiskSuite 4.2, the md.tab file is located in /etc/opt/SUNWmd. With Solstice DiskSuite 4.2.1, the md.tab file is located in /etc/lvm.
Follow these guidelines when setting up your disk configuration and the associated md.tab file.
It is advisable to maintain identical md.tab files on each node in the cluster to ease administration.
A multihost disk and all the partitions found on that disk can be included in no more than one diskset.
All metadevices used by data services must be fully mirrored. Two-way mirrors are recommended, but three-way mirrors are acceptable.
No components of a submirror for a given mirror should be found on the same controller as any other component in any other submirror used to define that mirror.
If more than two disk strings are used, each diskset must include disks from at least three separate controllers. If only two disk strings are used, each diskset must include disks from the two controllers and mediators will be configured. See the Sun Cluster 2.2 System Administration Guide for more information about using dual-string mediators.
Hot spares are recommended, but not required. If hot spares are used, configure them so that the activation of any hot spare drive will not result in components of a submirror for a given metamirror sharing the same controller with any other component in any other submirror used to define that given metamirror.
If you are using Solaris UFS logging, you only need to set up mirrored metadevices in md.tab files, transdevices are not necessary.
If your are using Solstice DiskSuite logging, create multihost file systems on trans metadevices only. Both the logging and master device components of each trans metadevice must be mirrored.
If you are using Solstice DiskSuite logging, do not share spindles between logging and master device components of the same trans metadevice, unless the devices are striped across multiple drives. Otherwise, system performance will be degraded.
Each diskset has a small administrative file system associated with it. This file system is not NFS shared. It is used for data service-specific state or configuration information. The administrative file system should be named the same as the logical host that is the default master for the diskset. This strategy is necessary to enable start up of DBMS fault monitors.
The ordering of lines in the md.tab file is not important, but construct your file in the "top down" fashion described below. The following sample md.tab file defines the metadevices for the diskset named green. The # character can be used to annotate the file. In this example, the logical host name is also green.
# administrative file system for logical host mounted under /green green/d0 -t green/d1 green/d4 green/d1 -m green/d2 green/d3 green/d2 1 1 /dev/did/rdsk/d1s4 green/d3 1 1 /dev/did/rdsk/d2s4 green/d4 -m green/d5 green/d6 green/d5 1 1 /dev/did/rdsk/d3s5 green/d6 1 1 /dev/did/rdsk/d4s5 # /green/web green/d10 -t green/d11 green/d14 green/d11 -m green/d12 green/d13 green/d12 1 1 /dev/did/rdsk/d1s0 green/d13 1 1 /dev/did/rdsk/d2s0 green/d14 -m green/d15 green/d16 green/d15 1 1 /dev/did/rdsk/d3s6 green/d16 1 1 /dev/did/rdsk/d4s6 #/green/home to be NFS-shared green/d20 -t green/d21 green/d24 green/d21 -m green/d22 green/d23 green/d22 1 1 /dev/did/rdsk/d3s0 green/d23 1 1 /dev/did/rdsk/d4s0 green/d24 -m green/d25 green/d26 green/d25 1 1 /dev/did/rdsk/d1s6 green/d26 1 1 /dev/did/rdsk/d2s6 |
The first line defines the administrative file system as the trans metadevice d0 to consist of a master (UFS) metadevice d1 and a log device d4. The -t signifies this is a trans metadevice; the master and log devices are implied by their position after the -t flag.
The second line defines the master device as a mirror of the metadevices. The -m in this definition signifies a mirror device.
green/d1 -m green/d2 green/d3 |
The fifth line similarly defines the log device, d4, as a mirror of metadevices.
green/d4 -m green/d5 green/d6 |
The third line defines the first submirror of the master device as a one-way stripe.
green/d2 1 1 /dev/did/rdsk/d1s4 |
The next line defines the other master submirror.
green/d3 1 1 /dev/did/rdsk/d2s4 |
Finally, the log device submirrors are defined. In this example, simple metadevices for each submirror are created.
green/d5 1 1 /dev/did/rdsk/d3s5 green/d6 1 1 /dev/did/rdsk/d4s5 |
Similarly, mirrors are created for two other applications: d10 will contain a Web server and files, and d20 will contain an NFS-shared file system.
If you have existing data on the disks that will be used for the submirrors, you must back up the data before metadevice setup and restore it onto the mirror.
This procedure assumes that you have ownership of the diskset on the node on which you will execute the metainit(1M) command. It also assumed that you have configured identical md.tab files on each node in the cluster. With Solstice DiskSuite 4.2, these files must be located in the /etc/opt/SUNWmd directory. With Solstice DiskSuite 4.2.1, the files must be in /etc/lvm.
As root, initialize the md.tab file by running the metainit(1M) command.
Take control of the diskset:
phys-hahost1# metaset -s hahost1 -t |
Initialize the md.tab file. The -a option activates all metadevices defined in the md.tab file. For example, this command initializes the md.tab file for diskset hahost1.
phys-hahost1# metainit -s hahost1 -a |
Repeat this for each diskset in the cluster.
If necessary, run the metainit(1M) command from another node that has connectivity to the disks. This is required for clustered pair and ring topologies, where the disks are not accessible by all nodes.
Use the metastat(1M) command to check the status of the metadevices.
phys-hahost1# metastat -s hahost1 |