Sun Cluster 2.2 Software Installation Guide

B.2.16 Using the md.tab File to Create Metadevices in Disksets

This section describes how to use the /etc/opt/SUNWmd/md.tab file to configure metadevices and hot spare pools.


Note -

If you have a previously generated md.tab file to convert to use disk IDs, you can use the script in "B.2.7 DID Conversion Script", to help with the conversion.


B.2.16.1 Creating an md.tab File

The /etc/opt/SUNWmd/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.


Note -

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.

B.2.16.2 md.tab File Creation Guidelines

Follow these guidelines when setting up your disk configuration and the associated md.tab file.

B.2.16.3 Sample md.tab File

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:

# 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/d3s
 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.