Solstice DiskSuite 4.2.1 Reference Guide

Chapter 6 The md.tab and md.cf Files

This chapter describes how to use the /ect/lvm/md.tab file. It also explains the purpose of the /ect/lvm/md.cf file. Use the following table to locate specific information in this chapter.

Overview of the md.tab File

The /ect/lvm/md.tab file is an ASCII file that the metainit(1M), metahs(1M), and metadb(1M) commands use as an input file. You can use the /ect/lvm/md.tab file to create metadevices, hot spare pools, and state database replicas in a way similar to batch processing (as opposed to using the command line or DiskSuite Tool). Once you have edited the file, the metainit(1M), metahs(1M), and metadb(1M) commands then activate the metadevices, hot spare pools, and state database replicas defined in the file.

When you edit the /ect/lvm/md.tab file, you specify one complete configuration entry for each line using the syntax of the metainit(1M), metadb(1M), and metahs(1M) commands.

You then run the metainit(1M) command with either the -a option, to activate all metadevices in the /ect/lvm/md.tab file, or with the metadevice name that corresponds to a specific entry in the file.


Note -

DiskSuite does not write to or store configuration information in the /ect/lvm/md.tab file. You must edit the file by hand and run the metainit(1M), metahs(1M), or metadb(1M) commands to create DiskSuite objects.


The following sections describe how to create state database replicas, metadevices, and hot spare pools using the md.tab file. For more information refer to the md.tab(4) man page.

Creating Initial State Database Replicas in the md.tab File

This example shows how to set up an initial state database on a server with three disks.


#
# (state database and replicas)
#
mddb01 -c 3 c0t1d0s0 c0t2d0s0 c0t3d0s0

This file entry creates three state database replicas on each of the three slices. mddb01 identifies the metadevice state database. -c 3 specifies that three state database replicas are placed on each slice. The metadb(1M) command activates this entry in the /ect/lvm/md.tab file.

Creating a Striped Metadevice in the md.tab File

This example shows a striped metadevice, /dev/md/dsk/d15, with two slices.


#
# (stripe consisting of two disks)
#
d15 1 2 c0t1d0s2 c0t2d0s2 -i 32k

The number 1 specifies to create a single stripe (a striped metadevice consisting of one stripe). The number 2 specifies how many slices to stripe. The -i 32k specifies a 32 Kbytes interlace value. (The default interlace value is 16 Kbytes.)

Creating a Concatenated Metadevice in the md.tab File

This example shows a metadevice, /dev/md/dsk/d7, that has a four-slice concatenated metadevice.


#
# (concatenation of four disks)
#
d7 4 1 c0t1d0s0 1 c0t2d0s0 1 c0t3d0s0 1 c0t4d0s0

The number 4 specifies to create four striped slices in the concatenated metadevice. Each stripe is made of one slice; therefore, you specify the number 1 for each slice.


Note -

The first disk sector in the concatenated metadevice contains a disk label. To preserve the disk labels on devices /dev/dsk/c0t2d0s0, /dev/dsk/c0t3d0s0, and /dev/dsk/c0t4d0s0,DiskSuite skips the entire first cylinder of these disks. This permits higher-level file system software to optimize block allocations correctly.


Creating a Concatenated Stripe in the md.tab File

This example shows a metadevice, /dev/md/dsk/d75, that consists of two stripes that are concatenated together.


#
# (concatenation of two stripes, each made of three disks)
#
d75 2 3 c0t1d0s2 c0t2d0s2 c0t3d0s2 -i 16k \

     3 c1t1d0s2 c1t2d0s2 c1t3d0s2 -i 32k

The -i 16k specifies a 16 Kbytes interlace value for the first stripe. The -i 32k specifies a 32 Kbyte for the second stripe. The address blocks for each set of three disks are interlaced across three disks.

Creating a Mirror in the md.tab File

This example shows a one-way mirror, /dev/md/dsk/d50, and two other concatenations that would be attached later to create a three-way mirror. The mirror does not contain any data.


#
#
# (mirror)
#
d50 -m d51
d51 1 1 c0t1d0s2
d52 1 1 c0t2d0s2
d53 1 1 c0t3d0s2

The -m creates a one-way mirror consisting of submirror d51. The other two submirrors, d52 and d53, must be attached later with the metattach(1M) command. The default read and write options in this example are a round-robin read policy and parallel write policy.

Creating a Trans Metadevice in the md.tab File

This example shows a trans metadevice, /dev/md/dsk/d1, with logging device and master device.


#
# (trans)
#
d1 -t d10 d20
d10 -m d11
d11 1 1 c0t1d0s2
d12 1 1 c0t2d0s2
d20 -m d21
d21 1 1 c1t1d0s2
d22 1 1 c1t2d0s2

The -m creates the two one-way mirrors, d10 and d20. The -t creates d10 as the master device and d20 as the logging device. The submirrors d12 and d22 are attached later by using the metattach(1M) command on the d10 and d20 mirrors.

Creating a RAID5 Metadevice in the md.tab File

This example shows a RAID5 metadevice, d80, with three slices.


#
# (RAID devices)
#
d80 -r c0t1d0s1 c1t0d0s1 c2t0d0s1 -i 20k

The -r creates the RAID5 metadevice. The -i specifies an interlace value of 20 Kbytes. DiskSuite will stripe the data and parity information across the slices c0t1d0s1, c1t0d0s1, and c2t0d0s1. If you wanted to concatenate more slices to the original RAID5 metadevice, you could do so later by using the metattach(1M) command.

Creating a Hot Spare Pool in the md.tab File

This example shows a one-way mirror, /dev/md/dsk/d10, and two other concatenations that would be attached later to create a three-way mirror. Three hot spare pools are created and associated with the submirrors.


#
# (mirror and hot spare)
#
d10 -m d20
d20 1 1 c1t0d0s2 -h hsp001
d30 1 1 c2t0d0s2 -h hsp002
d40 1 1 c3t0d0s2 -h hsp003
hsp001 c2t2d0s2 c3t2d0s2 c1t2d0s2
hsp002 c3t2d0s2 c1t2d0s2 c2t2d0s2
hsp003 c1t2d0s2 c2t2d0s2 c3t2d0s2

The -m creates a one-way mirror consisting of submirror d20. You attach the other submirrors, d30 and d40, later by using the metattach(1M) command. The -h specifies which hot spare pools belong to the submirrors. There are three disks used as hot spares, each associated with three separate hot spare pools, hsp001, hsp002, and hsp003.


Note -

The /ect/lvm/md.tab file can be used to both create and associate hot spare pools with metadevices at the same time.


Overview of the md.cf File

The /etc/lvm/md.cf file is a backup file of the DiskSuite configuration for a "local" diskset. You use the md.cf file for recovering from failures. Whenever you make a configuration change, the md.cf file is automatically updated (except for hot sparing). You never edit the md.cf file directly. If your system loses the information maintained in the metadevice state database, and as long as no metadevices were changed or created in the meantime, you can use the md.cf file to recover. Refer to Solstice DiskSuite 4.2.1 User's Guide for more information.