'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc.
.\" All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH md.tab 4 "15 Dec 2004" "SunOS 5.11" "File Formats"
.SH NAME
md.tab, md.cf \- Solaris Volume Manager utility files
.SH SYNOPSIS
.LP
.nf
\fB/etc/lvm/md.tab\fR 
\fB/etc/lvm/md.cf\fR 
.fi

.SH DESCRIPTION
.sp
.LP
The file \fB/etc/lvm/md.tab\fR can be used by \fBmetainit\fR(1M) and
\fBmetadb\fR(1M) to configure metadevices, hot spare pools, and metadevice
state database replicas in a batch-like mode. Solaris Volume Manager does not
store configuration information in the \fB/etc/lvm/md.tab\fR file. You can use:
.sp
.in +2
.nf
metastat -p > /etc/lvm/md.tab
.fi
.in -2
.sp

.sp
.LP
to create this file. Edit it by hand using the instructions in the
\fBmd.tab.4\fR file. Similarly, if no hot spares are in use, the \fBcp md.cf
md.tab\fR command generates an acceptable version of the \fBmd.tab\fR file,
with the editing caveats previously mentioned.
.sp
.LP
When using the \fBmd.tab\fR file, each metadevice, hot spare pool, or state
database replica in the file must have a unique entry. Entries can include the
following: simple metadevices (stripes, concatenations, and concatenations of
stripes); mirrors, soft partitions, and RAID5 metadevices; hot spare pools; and
state database replicas. Because \fBmd.tab\fR contains only entries that you
enter in it, do not rely on the file for the current configuration of
metadevices, hot spare pools, and replicas on the system at any given time.
.sp
.LP
Tabs, spaces, comments (by using a pound sign, \fB#\fR), and continuation of
lines (by using a backslash-newline), are allowed.
.sp
.LP
Typically, you set up metadevices according to information specified on the
command line by using the \fBmetainit\fR command. Likewise, you set up state
database replicas with the \fBmetadb\fR command.
.sp
.LP
An alternative to the command line is to use the \fBmd.tab\fR file. Metadevices
and state database replicas can be specified in the \fBmd.tab\fR file in any
order, and then activated in a batch-like mode with the \fBmetainit\fR and
\fBmetadb\fR commands.
.sp
.LP
If you edit the \fBmd.tab\fR file, you specify one complete configuration entry
per line. Metadevices are defined using the same syntax as required by the
\fBmetainit\fR command. You then run the \fBmetainit\fR command with either the
\fB-a\fR option, to activate all metadevices in the \fBmd.tab\fR file, or with
the metadevice name corresponding to a specific configuration entry.
.sp
.LP
\fBmetainit\fR does not maintain the state of the volumes that would have been
created when \fBmetainit\fR is run with both the \fB-a\fR and \fB-n\fR flags.
If a device \fBd0\fR is created in the first line of the \fBmd.tab\fR file, and
a later line in \fBmd.tab\fR assumes the existence of \fBd0\fR, the later line
will fail when \fBmetainit\fR \fB-an\fR runs (even if it would succeed with
\fBmetainit\fR \fB-a\fR).
.sp
.LP
State database replicas are defined in the \fB/etc/lvm/md.tab\fR file as
follows: \fBmddb\fR \fInumber options\fR [ \fIslice\fR... ] Where \fBmddb\fR
\fInumber\fR is the characters \fBmddb\fR followed by a number of two or more
digits that identifies the state database replica. \fIslice\fR is a physical
slice. For example: \fBmddb05 /dev/dsk/c0t1d0s2\fR. The file
\fB/etc/lvm/md.cf\fR is a backup of the configuration used for disaster
recovery. Whenever the Volume Manager configuration is changed, this file is
automatically updated (except when hot sparing occurs). You should not directly
edit this file.
.SH EXAMPLES
.LP
\fBExample 1 \fRConcatenation
.sp
.LP
All drives in the following examples have the same size of 525 Mbytes.

.sp
.LP
This example shows a metadevice, \fB/dev/md/dsk/d7\fR, consisting of a
concatenation of four disks.

.sp
.in +2
.nf
#
# (concatenation of four disks)
#
d7 4 1 c0t1d0s0 1 c0t2d0s0 1 c0t3d0s0 1 c0t4d0s0 
.fi
.in -2

.sp
.LP
The number 4 indicates there are four individual stripes in the concatenation.
Each stripe is made of one slice, hence the number 1 appears in front of each
slice. Note that the first disk sector in all of the above devices contains a
disk label. To preserve the labels on devices \fB/dev/dsk/c0t2d0s0\fR,
\fB/dev/dsk/c0t3d0s0\fR, and \fB/dev/dsk/c0t4d0s0\fR, the metadisk driver must
skip at least the first sector of those disks when mapping accesses across the
concatenation boundaries. Since skipping only the first sector would create an
irregular disk geometry, the entire first cylinder of these disks will be
skipped. This allows higher level file system software to optimize block
allocations correctly.

.LP
\fBExample 2 \fRStripe
.sp
.LP
This example shows a metadevice, \fB/dev/md/dsk/d15\fR, consisting of two
slices.

.sp
.in +2
.nf
#
# (stripe consisting of two disks)
#
d15 1 2 c0t1d0s2 c0t2d0s2 -i 32k
.fi
.in -2

.sp
.LP
The number 1 indicates that one stripe is being created. Because the stripe is
made of two slices, the number 2 follows next. The optional \fB-i\fR followed
by \fB32k\fR specifies the interlace size will be 32 Kbytes. If the interlace
size were not specified, the stripe would use the default value of 16 Kbytes.

.LP
\fBExample 3 \fRConcatenation of Stripes
.sp
.LP
This example shows a metadevice, \fB/dev/md/dsk/d75\fR, consisting of a
concatenation of two stripes of three disks.

.sp
.in +2
.nf
#
# (concatenation of two stripes, each consisting of three disks)
#
d75 2 3 c0t1d0s2 c0t2d0s2 c0t3d0s2 -i 16k \e
      3 c1t1d0s2 c1t2d0s2 c1t3d0s2 -i 32k
.fi
.in -2

.sp
.LP
On the first line, the \fB-i\fR followed by \fB16k\fR specifies that the
stripe's interlace size is 16 Kbytes. The second set specifies the stripe
interlace size will be 32 Kbytes. If the second set did not specify 32 Kbytes,
the set would use default interlace value of 16 Kbytes. The blocks of each set
of three disks are interlaced across three disks.

.LP
\fBExample 4 \fRMirroring
.sp
.LP
This example shows a three-way mirror, \fB/dev/md/dsk/d50\fR, consisting of
three submirrors. This mirror does not contain any existing data.

.sp
.in +2
.nf
#
# (mirror)
#
d50 -m d51 
d51 1 1 c0t1d0s2
d52 1 1 c0t2d0s2
d53 1 1 c0t3d0s2
.fi
.in -2

.sp
.LP
In this example, a one-way mirror is first defined using the \fB-m\fR option.
The one-way mirror consists of submirror \fBd51\fR. The other two submirrors,
\fBd52\fR and \fBd53\fR, are attached later using the \fBmetattach\fR command.
The default read and write options in this example are a round-robin read
algorithm and parallel writes to all submirrors. The order in which mirrors
appear in the \fB/etc/lvm/md.tab\fR file is unimportant.

.LP
\fBExample 5 \fRRAID5
.sp
.LP
This example shows a RAID5 metadevice, \fBd80\fR, consisting of three slices:

.sp
.in +2
.nf
#
# (RAID devices)
#
d80 -r c0t1d0s1 c1t0d0s1 c2t0d0s1 -i 20k
.fi
.in -2

.sp
.LP
In this example, a RAID5 metadevice is defined using the \fB-r\fR option with
an interlace size of 20 Kbytes. The data and parity segments will be striped
across the slices, \fBc0t1d0s1\fR, \fBc1t0d0s1\fR, and \fBc2t0d0s1\fR.

.LP
\fBExample 6 \fRSoft Partition
.sp
.LP
This example shows a soft partition, \fBd85\fR, that reformats an entire 9 GB
disk. Slice 0 occupies all of the disk except for the few Mbytes taken by slice
7, which is space reserved for a state database replica. Slice 7 will be a
minimum of 4Mbytes, but could be larger, depending on the disk geometry.
\fBd85\fR sits on \fBc3t4d0s0\fR.

.sp
.LP
Drives are repartitioned when they are added to a diskset only if Slice 7 is
not set up correctly. A small portion of each drive is reserved in Slice 7 for
use by Volume Manager. The remainder of the space on each drive is placed into
Slice 0. Any existing data on the disks is lost after repartitioning. After
adding a drive to a diskset, you can repartition the drive as necessary.
However, Slice 7 should not be moved, removed, or overlapped with any other
partition.

.sp
.LP
Manually specifying the offsets and extents of soft partitions is not
recommended. This example is included for to provide a better understanding of
the file if it is automatically generated and for completeness.

.sp
.in +2
.nf
#
# (Soft Partitions)
d85 -p -e c3t4d0 9g
.fi
.in -2

.sp
.LP
In this example, creating the soft partition and required space for the state
database replica occupies all 9 GB of disk \fBc3t4d0\fR.

.LP
\fBExample 7 \fRSoft Partition
.sp
.LP
This example shows the command used to re-create a soft partition with two
extents, the first one starting at offset 20483 and extending for 20480 blocks
and the second extent starting at 135398 and extending for 20480 blocks:

.sp
.in +2
.nf
#
# (Soft Partitions)
#
d1 -p c0t3d0s0 -o 20483 -b 20480 -o 135398 -b 20480
.fi
.in -2

.LP
\fBExample 8 \fRHot Spare
.sp
.LP
This example shows a three-way mirror, \fB/dev/md/dsk/d10\fR, consisting of
three submirrors and three hot spare pools.

.sp
.in +2
.nf
#
# (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
.fi
.in -2

.sp
.LP
In this example, a one-way mirror is first defined using the \fB-m\fR option.
The submirrors are attached later using the \fBmetattach\fR(1M) command. The
hot spare pools to be used are tied to the submirrors with the \fB-h\fR option.
In this example, there are three disks used as hot spares, defined in three
separate hot spare pools. The hot spare pools are given the names \fBhsp001\fR,
\fBhsp002\fR, and \fBhsp003\fR. Setting up three hot spare pools rather than
assigning just one hot spare with each component helps to maximize the use of
hardware. This configuration enables the user to specify that the most
desirable hot spare be selected first, and improves availability by having more
hot spares available. At the end of the entry, the hot spares to be used are
defined. Note that, when using the \fBmd.tab\fR file, to associate hot spares
with metadevices, the hot spare spool does not have to exist prior to the
association. Volume Manager takes care of the order in which metadevices and
hot spares are created when using the \fBmd.tab\fR file.

.LP
\fBExample 9 \fRState Database Replicas
.sp
.LP
This example shows how to set up an initial state database and three replicas
on a server that has three disks.

.sp
.in +2
.nf
#
# (state database and replicas)
#
mddb01 -c 3 c0t1d0s0 c0t2d0s0 c0t3d0s0
.fi
.in -2

.sp
.LP
In this example, three state database replicas are stored on each of the three
slices. Once the above entry is made in the \fB/etc/lvm/md.tab\fR file, the
\fBmetadb\fR command must be run with both the \fB-a\fR and \fB-f\fR options.
For example, typing the following command creates one state database replicas
on three slices:

.sp
.in +2
.nf
# metadb -a -f mddb01
.fi
.in -2

.SH FILES
.RS +4
.TP
.ie t \(bu
.el o
\fB/etc/lvm/md.tab\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
\fB/etc/lvm/md.cf\fR
.RE
.SH SEE ALSO
.sp
.LP
\fBmdmonitord\fR(1M), \fBmetaclear\fR(1M), \fBmetadb\fR(1M),
\fBmetadetach\fR(1M), \fBmetahs\fR(1M), \fBmetainit\fR(1M),
\fBmetaoffline\fR(1M), \fBmetaonline\fR(1M), \fBmetaparam\fR(1M),
\fBmetarecover\fR(1M), \fBmetarename\fR(1M), \fBmetareplace\fR(1M),
\fBmetaroot\fR(1M), \fBmetassist\fR(1M), \fBmetaset\fR(1M), \fBmetastat\fR(1M),
\fBmetasync\fR(1M), \fBmetattach\fR(1M), \fBmd.cf\fR(4), \fBmddb.cf\fR(4),
\fBattributes\fR(5), \fBmd\fR(7D)
.sp
.LP
\fISolaris Volume Manager Administration Guide\fR
.SH LIMITATIONS
.sp
.LP
Recursive mirroring is not allowed; that is, a mirror cannot appear in the
definition of another mirror.
.sp
.LP
Recursive logging is not allowed.
.sp
.LP
Stripes and RAID5 metadevices must contains slices or soft partitions only.
.sp
.LP
Mirroring of RAID5 metadevices is not allowed.
.sp
.LP
Soft partitions can be built directly on slices or can be the top level
(accessible by applications directly), but cannot be in the middle, with other
metadevices above and below them.
.SH NOTES
.sp
.LP
Trans metadevices have been replaced by UFS logging. Existing trans devices are
\fBnot\fR logging--they pass data directly through to the underlying device.
See \fBmount_ufs\fR(1M) for more information about UFS logging.