6253 F_GETLK doesn't always return lock owner
[illumos-gate.git] / usr / src / man / man1m / metainit.1m
blob10e989957b8ac6d6ce8b63a2f74cc766a8ebac1e
1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH METAINIT 1M "Mar 27, 2006"
7 .SH NAME
8 metainit \- configure metadevices
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/sbin/metainit\fR \fB-h\fR
13 .fi
15 .LP
16 .nf
17 \fB/sbin/metainit\fR [\fIgeneric options\fR] \fIconcat/stripe\fR \fInumstripes\fR \fIwidth\fR
18      \fIcomponent...\fR [\fB-i\fR \fIinterlace\fR]
19 .fi
21 .LP
22 .nf
23 \fB/sbin/metainit\fR [\fIwidth\fR \fIcomponent...\fR [\fB-i\fR \fIinterlace\fR]]
24      [\fB-h\fR \fIhot_spare_pool\fR]
25 .fi
27 .LP
28 .nf
29 \fB/sbin/metainit\fR [\fIgeneric options\fR] \fImirror\fR \fB-m\fR \fIsubmirror\fR
30      [\fIread_options\fR] [\fIwrite_options\fR]
31      [\fIpass_num\fR]
32 .fi
34 .LP
35 .nf
36 \fB/sbin/metainit\fR [\fIgeneric options\fR] \fIRAID\fR \fB-r\fR \fIcomponent...\fR
37      [\fB-i\fR \fIinterlace\fR]
38      [\fB-h\fR \fIhot_spare_pool\fR] [\fB-k\fR] [\fB-o\fR \fIoriginal_column_count\fR]
39 .fi
41 .LP
42 .nf
43 \fB/sbin/metainit\fR [\fIgeneric options\fR] \fIhot_spare_pool\fR
44      [\fIhotspare...\fR]
45 .fi
47 .LP
48 .nf
49 \fB/sbin/metainit\fR [\fIgeneric options\fR] \fImetadevice-name\fR
50 .fi
52 .LP
53 .nf
54 \fB/sbin/metainit\fR [\fIgeneric options\fR] \fB-a\fR
55 .fi
57 .LP
58 .nf
59 \fB/sbin/metainit\fR [\fIgeneric options\fR] \fIsoftpart\fR \fB-p\fR [\fB-e\fR] \fIcomponent\fR
60      [\fB-A\fR \fIalignment\fR] \fIsize\fR
61 .fi
63 .LP
64 .nf
65 \fB/sbin/metainit\fR \fB-r\fR
66 .fi
68 .SH DESCRIPTION
69 .sp
70 .LP
71 The \fBmetainit\fR command configures metadevices and hot spares according to
72 the information specified on the command line. Alternatively, you can run
73 \fBmetainit\fR so that it uses configuration entries you specify in the
74 \fB/etc/lvm/md.tab\fR file (see \fBmd.tab\fR(4)). All metadevices must be set
75 up by the \fBmetainit\fR command before they can be used.
76 .sp
77 .LP
78 Solaris Volume Manager supports storage devices and logical volumes greater
79 than 1 terabyte (TB) when a system runs a 64-bit Solaris kernel. Support for
80 large volumes is automatic. If a device greater than 1 TB is created, Solaris
81 Volume Manager configures it appropriately and without user intervention.
82 .sp
83 .LP
84 If a system with large volumes is rebooted under a 32-bit Solaris kernel, the
85 large volumes are visible through \fBmetastat\fR output. Large volumes cannot
86 be accessed, modified or deleted, and no new large volumes can be created. Any
87 volumes or file systems on a large volume in this situation are unavailable. If
88 a system with large volumes is rebooted under a version of Solaris prior to the
89 Solaris 9 4/03 release, Solaris Volume Manager does not start. You must remove
90 all large volumes before Solaris Volume Manager runs under an earlier version
91 of the Solaris Operating System.
92 .sp
93 .LP
94 If you edit the \fB/etc/lvm/md.tab\fR file to configure metadevices, specify
95 one complete configuration entry per line. You then run the \fBmetainit\fR
96 command with either the \fB-a\fR option, to activate all metadevices you
97 entered in the \fB/etc/lvm/md.tab\fR file, or with the metadevice name
98 corresponding to a specific configuration entry.
99 .sp
101 \fBmetainit\fR does not maintain the state of the volumes that would have been
102 created when \fBmetainit\fR is run with both the \fB-a\fR and \fB-n\fR flags.
103 Any volumes in \fBmd.tab\fR that have dependencies on other volumes in
104 \fBmd.tab\fR are reported as errors when \fBmetainit\fR \fB-a\fR \fB-n\fR is
105 run, although the operations might succeed when \fBmetainit\fR \fB-a\fR is run.
106 See \fBmd.tab\fR(4).
109 Solaris Volume Manager never updates the \fB/etc/lvm/md.tab\fR file. Complete
110 configuration information is stored in the metadevice state database, not
111 \fBmd.tab\fR. The only way information appears in \fBmd.tab\fR is through
112 editing it by hand.
115 When setting up a disk mirror, the \fBfirst\fR step is to use \fBmetainit\fR
116 create a one-on-one concatenation for the root slice. See \fBEXAMPLES\fR.
117 .SH OPTIONS
120 The following options are supported:
121 .SS "Generic Options"
124 Root privileges are required for all of the following options except \fB-h\fR.
127 The following generic options are supported:
129 .ne 2
131 \fB\fB-f\fR\fR
133 .sp .6
134 .RS 4n
135 Forces the \fBmetainit\fR command to continue even if one of the slices
136 contains a mounted file system or is being used as \fBswap\fR, or if the stripe
137 being created is smaller in size than the underlying soft partition. This
138 option is required when configuring mirrors on root (\fB/\fR), \fBswap\fR, and
139 \fB/usr\fR.
143 .ne 2
145 \fB\fB-h\fR\fR
147 .sp .6
148 .RS 4n
149 Displays usage message.
153 .ne 2
155 \fB\fB-n\fR\fR
157 .sp .6
158 .RS 4n
159 Checks the syntax of your command line or \fBmd.tab\fR entry without actually
160 setting up the metadevice. If used with \fB-a\fR, all devices are checked but
161 not initialized.
165 .ne 2
167 \fB\fB-r\fR\fR
169 .sp .6
170 .RS 4n
171 Only used in a shell script at boot time. Sets up all metadevices that were
172 configured before the system crashed or was shut down. The information about
173 previously configured metadevices is stored in the metadevice state database
174 (see \fBmetadb\fR(1M)).
178 .ne 2
180 \fB\fB-s\fR \fB\fIsetname\fR\fR\fR
182 .sp .6
183 .RS 4n
184 Specifies the name of the diskset on which \fBmetainit\fR works. Without the
185 \fB-s\fR option, the \fBmetainit\fR command operates on your local metadevices
186 and/or hotspares.
189 .SS "Concat/Stripe Options"
192 The following concat/stripe options are supported:
194 .ne 2
196 \fB\fIconcat/stripe\fR\fR
198 .sp .6
199 .RS 4n
200 Specifies the metadevice name of the concatenation, stripe, or concatenation of
201 stripes being defined.
205 .ne 2
207 \fB\fInumstripes\fR\fR
209 .sp .6
210 .RS 4n
211 Specifies the number of individual stripes in the metadevice. For a simple
212 stripe, \fInumstripes\fR is always 1. For a concatenation, \fInumstripes\fR is
213 equal to the number of slices. For a concatenation of stripes, \fInumstripes\fR
214 varies according to the number of stripes.
218 .ne 2
220 \fB\fIwidth\fR\fR
222 .sp .6
223 .RS 4n
224 Specifies the number of slices that make up a stripe. When \fIwidth\fR is
225 greater than 1, the slices are striped.
229 .ne 2
231 \fB\fIcomponent\fR\fR
233 .sp .6
234 .RS 4n
235 The logical name for the physical slice (partition) on a disk drive, such as
236 \fB/dev/dsk/c0t0d0s0\fR. For RAID level 5 metadevices, a minimum of three
237 slices is necessary to enable striping of the parity information across slices.
241 .ne 2
243 \fB\fB-i\fR \fB\fIinterlace\fR\fR\fR
245 .sp .6
246 .RS 4n
247 Specifies the interlace size. This value tells Solaris Volume Manager how much
248 data to place on a slice of a striped or RAID level 5 metadevice before moving
249 on to the next slice. \fIinterlace\fR is a specified value, followed by either
250 `\fBk\fR' for kilobytes, `\fBm\fR' for megabytes, or `\fBb\fR' for blocks. The
251 characters can be either uppercase or lowercase. The \fIinterlace\fR specified
252 cannot be less than 16 blocks, or greater than 100 megabytes. If
253 \fIinterlace\fR is not specified, it defaults to 512 kilobytes.
257 .ne 2
259 \fB\fB-h\fR \fB\fIhot_spare_pool\fR\fR\fR
261 .sp .6
262 .RS 4n
263 Specifies the \fIhot_spare_pool\fR to be associated with the metadevice. If you
264 use the command line, the hot spare pool must have been previously created by
265 the \fBmetainit\fR command before it can be associated with a metadevice. Use
266 \fB/-h\fR \fBhsp\fR\fInnn\fR when the concat/stripe being created is to be used
267 as a submirror.
269 Names for hot spare pools can be any legal file name that is composed of
270 alphanumeric characters, a dash ("-"), an underscore ("_"), or a period (".").
271 Names must begin with a letter. The words "all" and "none" are reserved and
272 cannot be used.
275 .SS "Mirror Options"
278 The following mirror options are supported:
280 .ne 2
282 \fB\fImirror\fR \fB-m\fR \fI\fR\fIsubmirror\fR\fI\fR\fR
284 .sp .6
285 .RS 4n
286 Specifies the metadevice name of the mirror. The \fB-m\fR indicates that the
287 configuration is a mirror. \fIsubmirror\fR is a metadevice (stripe or
288 concatentation) that makes up the initial one-way mirror. Solaris Volume
289 Manager supports a maximum of four-way mirroring. When defining mirrors, first
290 create the mirror with the \fBmetainit\fR command as a one-way mirror. Then
291 attach subsequent submirrors using the \fBmetattach\fR command. This method
292 ensures that Solaris Volume Manager properly syncs the mirrors. (The second and
293 any subsequent submirrors are first created using the \fBmetainit\fR command.)
297 .ne 2
299 \fB\fIread_options\fR\fR
301 .sp .6
302 .RS 4n
303 The following read options for mirrors are supported:
305 .ne 2
307 \fB\fB-g\fR\fR
309 .sp .6
310 .RS 4n
311 Enables the geometric read option, which results in faster performance on
312 sequential reads.
316 .ne 2
318 \fB\fB-r\fR\fR
320 .sp .6
321 .RS 4n
322 Directs all reads to the first submirror. This should only be used when the
323 devices comprising the first submirror are substantially faster than those of
324 the second mirror. This flag cannot be used with the \fB-g\fR flag.
327 If neither the \fB-g\fR nor \fB-r\fR flags are specified, reads are made in a
328 round-robin order from all submirrors in the mirror. This enables load
329 balancing across the submirrors.
333 .ne 2
335 \fB\fIwrite_options\fR\fR
337 .sp .6
338 .RS 4n
339 The following write options for mirrors are supported:
341 .ne 2
343 \fB\fB-S\fR\fR
345 .sp .6
346 .RS 4n
347 Performs serial writes to mirrors. The first submirror write completes before
348 the second is started. This can be useful if hardware is susceptible to partial
349 sector failures. If \fB-S\fR is not specified, writes are replicated and
350 dispatched to all mirrors simultaneously.
356 .ne 2
358 \fB\fIpass_num\fR\fR
360 .sp .6
361 .RS 4n
362 A number in the range 0-9 at the end of an entry defining a mirror that
363 determines the order in which that mirror is resynced during a reboot. The
364 default is 1. Smaller pass numbers are resynced first. Equal pass numbers are
365 run concurrently. If 0 is used, the resync is skipped. 0 should be used only
366 for mirrors mounted as read-only, or as \fBswap\fR.
369 .SS "RAID Level 5 Options"
372 The following RAID level 5 options are available:
374 .ne 2
376 \fB\fIRAID\fR \fB-r\fR\fR
378 .sp .6
379 .RS 4n
380 Specifies the name of the RAID level 5 metadevice. The \fB-r\fR specifies that
381 the configuration is RAID level 5.
385 .ne 2
387 \fB\fB-k\fR\fR
389 .sp .6
390 .RS 4n
391 For RAID level 5 metadevices, informs the driver that it is not to initialize
392 (zero the disk blocks) due to existing data. Only use this option to recreate a
393 previously created RAID level 5 device.
395 Use the \fB-k\fR option with extreme caution. This option sets the disk blocks
396 to the \fBOK\fR state. If any errors exist on disk blocks within the
397 metadevice, Solaris Volume Manager might begin fabricating data. Instead of
398 using the \fB-k\fR option, you might want to initialize the device and restore
399 data from tape.
403 .ne 2
405 \fB\fB-o\fR \fB\fIoriginal_column_count\fR\fR\fR
407 .sp .6
408 .RS 4n
409 For RAID level 5 metadevices, used with the \fB-k\fR option to define the
410 number of original slices in the event the originally defined metadevice was
411 grown. This is necessary since the parity segments are not striped across
412 concatenated devices.
414 Use the \fB-o\fR option with extreme caution. This option sets the disk blocks
415 to the \fBOK\fR state. If any errors exist on disk blocks within the
416 metadevice, Solaris Volume Manager might begin fabricating data. Instead of
417 using the \fB-o\fR option, you might want to initialize the device and restore
418 data from tape.
421 .SS "Soft Partition Options"
424 The following soft partition options are supported:
426 .ne 2
428 \fB\fIsoftpart\fR \fB-p\fR [\fB-e\fR] \fIcomponent\fR [\fB-A\fR
429 \fIalignment\fR] \fIsize\fR\fR
431 .sp .6
432 .RS 4n
433 The \fIsoftpart\fR argument specifies the name of the soft partition. The
434 \fB-p\fR specifies that the configuration is a soft partition.
436 The \fB-e\fR specifies that the entire disk specified by \fIcomponent\fR as
437 \fBc*t*d*\fR should be repartitioned and reserved for soft partitions. The
438 specified component is repartitioned such that slice 7 reserves space for
439 system (state database replica) usage and slice 0 contains all remaining space
440 on the disk. Slice 7 is a minimum of 4MB, but can be larger, depending on the
441 disk geometry. The newly created soft partition is placed on slice 0 of the
442 device.
444 The \fIcomponent\fR argument specifies the disk (\fBc*t*d*\fR), slice
445 (\fBc*t*d*s*\fR), or meta device (\fBd*\fR) from which to create the soft
446 partition. The \fIsize\fR argument determines the space to use for the soft
447 partition and can be specified in \fBK\fR or \fBk\fR for kilobytes, \fBM\fR or
448 \fBm\fR for megabytes, \fBG\fR or \fBg\fR for gigabytes, \fBT\fR or \fBt\fR for
449 terabyte (one terabyte is the maximum size), and \fBB\fR or \fBb\fR for blocks
450 (sectors). All values represent powers of 2, and upper and lower case options
451 are equivalent. Only integer values are permitted.
453 The \fB-A\fR alignment option sets the value of the soft partition extent
454 alignment. This option used when it is important specify a starting offset for
455 the soft partition. It preserves the data alignment between the metadevice
456 address space and the address space of the underlying physical device. For
457 example, a hardware device that does checksumming should not have its I/O
458 requests divided by Solaris Volume Manager. In this case, use a value from the
459 hardware configuration as the value for the alignment. When you use this option
460 in conjunction with a software I/O load, the alignment value corresponds to the
461 I/O load of the application. This prevents I/O from being divided unnecessarily
462 and affecting performance.
464 The literal \fBall\fR, used instead of specifying size, specifies that the soft
465 partition should occupy all available space on the device.
468 .SS "Hot Spare Pool Options"
471 The following hot spare pool options are supported:
473 .ne 2
475 \fB\fIhot_spare_pool\fR \fI\fR\fB[\fR\fI\fR \fI\fR\fIhotspare...\fR\fI\fR
476 \fI\fR\fB]\fR\fI\fR\fR
478 .sp .6
479 .RS 4n
480 When used as arguments to the \fBmetainit\fR command, \fIhot_spare_pool\fR
481 defines the name for a hot spare pool, and \fIhotspare...\fR is the logical
482 name for the physical slice(s) for availability in that pool. Names for hot
483 spare pools can be any legal file name that is composed of alphanumeric
484 characters, a dash ("-"), an underscore ("_"), or a period ("."). Names must
485 begin with a letter. The words "all" and "none" are reserved and cannot be
486 used.
489 .SS "\fBmd.tab\fR File Options"
492 The following \fBmd.tab\fR file options are supported:
494 .ne 2
496 \fB\fImetadevice-name\fR\fR
498 .sp .6
499 .RS 4n
500 When the \fBmetainit\fR command is run with a \fImetadevice-name\fR as its only
501 argument, it searches the \fB/etc/lvm/md.tab\fR file to find that name and its
502 corresponding entry. The order in which entries appear in the \fBmd.tab\fR file
503 is unimportant. For example, consider the following \fBmd.tab\fR entry:
505 .in +2
507 d0 2 1 c1t0d0s0 1 c2t1d0s0
509 .in -2
512 When you run the command \fBmetainit d0\fR, it configures metadevice \fBd0\fR
513 based on the configuration information found in the \fBmd.tab\fR file.
517 .ne 2
519 \fB\fB-a\fR\fR
521 .sp .6
522 .RS 4n
523 Activates all metadevices defined in the \fBmd.tab\fR file.
525 \fBmetainit\fR does not maintain the state of the volumes that would have been
526 created when \fBmetainit\fR is run with both the \fB-a\fR and \fB-n\fR flags.
527 If a device \fBd0\fR is created in the first line of the \fBmd.tab\fR file, and
528 a later line in \fBmd.tab\fR assumes the existence of \fBd0\fR, the later line
529 fails when \fBmetainit\fR \fB-an\fR runs (even if it would succeed with
530 \fBmetainit\fR \fB-a\fR).
533 .SH EXAMPLES
535 \fBExample 1 \fRCreating a One-on-One Concatenation
538 The following command creates a one-on-one concatenation for the root slice.
539 This is the first step you take when setting up a mirror for the root slice
540 (and any other slice that cannot be unmounted). The \fB-f\fR option is required
541 to create a volume with an existing file system, such as root(\fB/\fR).
544 .in +2
546 # metainit \fB-f\fR dl 1 1 c0t0d0s0
548 .in -2
553 The preceding command makes \fBd1\fR a one-on-one concatenation, using the root
554 slice. You can then enter:
557 .in +2
559 # metainit d0 -m d1
561 .in -2
566 \&...to make a one-way mirror of the root slice.
569 \fBExample 2 \fRConcatenation
572 All drives in the following examples have the same size of 525 Mbytes.
576 This example shows a metadevice, \fB/dev/md/dsk/d7\fR, consisting of a
577 concatenation of four slices.
580 .in +2
582 # metainit d7 4 1 c0t1d0s0 1 c0t2d0s0 1 c0t3d0s0 1 /dev/dsk/c0t4d0s0
584 .in -2
589 The number 4 indicates there are four individual stripes in the concatenation.
590 Each stripe is made of one slice, hence the number 1 appears in front of each
591 slice. The first disk sector in all of these devices contains a disk label. To
592 preserve the labels on devices \fB/dev/dsk/c0t2d0s0\fR,
593 \fB/dev/dsk/c0t3d0s0\fR, and \fB/dev/dsk/c0t4d0s0\fR, the metadisk driver must
594 skip at least the first sector of those disks when mapping accesses across the
595 concatenation boundaries. Because skipping only the first sector would create
596 an irregular disk geometry, the entire first cylinder of these disks is
597 skipped. This allows higher level file system software to optimize block
598 allocations correctly.
601 \fBExample 3 \fRStripe
604 This example shows a metadevice, \fB/dev/md/dsk/d15\fR, consisting of two
605 slices.
608 .in +2
610 # metainit d15 1 2 c0t1d0s0 c0t2d0s0 -i 32k
612 .in -2
617 The number 1 indicates that one stripe is being created. Because the stripe is
618 made of two slices, the number 2 follows next. The optional \fB-i\fR followed
619 by \fB32k\fR specifies the interlace size as 32 Kbytes. If the interlace size
620 were not specified, the stripe would use the default value of 16 Kbytes.
623 \fBExample 4 \fRConcatentation of Stripes
626 This example shows a metadevice, \fB/dev/md/dsk/d75\fR, consisting of a
627 concatenation of two stripes of three disks.
630 .in +2
632 # metainit d75 2 3 c0t1d0s0 c0t2d0s0 \e
633       c0t3d0s0 -i 16k \e
634       3 c1t1d0s0 c1t2d0s0 c1t3d0s0 -i 32k
636 .in -2
641 On the first line, the \fB-i\fR followed by 16k specifies that the stripe
642 interlace size is 16 Kbytes. The second set specifies the stripe interlace size
643 as 32 Kbytes. If the second set did not specify 32 Kbytes, the set would use
644 the default interlace value of 16 Kbytes. The blocks of each set of three disks
645 are interlaced across three disks.
648 \fBExample 5 \fRMirroring
651 This example shows a two-way mirror, \fB/dev/md/dsk/d50\fR, consisting of two
652 submirrors. This mirror does not contain any existing data.
655 .in +2
657 # metainit d51 1 1 c0t1d0s0
658 # metainit d52 1 1 c0t2d0s0
659 # metainit d50 -m d51
660 # metattach d50 d52
662 .in -2
667 In this example, two submirrors, \fBd51\fR and \fBd52\fR, are created with the
668 \fBmetainit\fR command. These two submirrors are simple concatenations. Next, a
669 one-way mirror, \fBd50\fR, is created using the \fB-m\fR option with \fBd51\fR.
670 The second submirror is attached later using the \fBmetattach\fR command. When
671 creating a mirror, any combination of stripes and concatenations can be used.
672 The default read and write options in this example are a round-robin read
673 algorithm and parallel writes to all submirrors.
676 \fBExample 6 \fRCreating a metadevice in a diskset
679 This example shows a metadevice, \fB/dev/md/dsk/d75\fR, consisting of a
680 concatenation of two stripes within a diskset called \fBset1\fR.
683 .in +2
685 # metainit -s set1 d75 2 3 c2t1d0s0 c2t2d0s0 \e
686       c2t3d0s0 -i 32k
687 # metainit -s set1 d51 1 1 c2t1d0s0
688 # metainit -s set1 d52 1 1 c3t1d0s0
689 # metainit -s set1 d50 -m d51
690 # metattach -s set1 d50 d52
692 .in -2
697 In this example, a diskset is created using the \fBmetaset\fR command.
698 Metadevices are then created within the diskset using the \fBmetainit\fR
699 command. The two submirrors, \fBd51\fR and \fBd52\fR, are simple
700 concatenations. Next, a one-way mirror, \fBd50\fR, is created using the
701 \fB-m\fR option with \fBd51\fR. The second submirror is attached later using
702 the \fBmetattach\fR command. When creating a mirror, any combination of stripes
703 and concatenations can be used. The default read and write options in this
704 example are a round-robin read algorithm and parallel writes to all submirrors.
707 \fBExample 7 \fRRAID Level 5
710 This example shows a RAID level 5 device, \fBd80\fR, consisting of three
711 slices:
714 .in +2
716 # metainit d80 -r c1t0d0s0 c1t1d0s0 c1t3d0s0 -i 20k
718 .in -2
723 In this example, a RAID level 5 metadevice is defined using the \fB-r\fR option
724 with an interlace size of 20 Kbytes. The data and parity segments are striped
725 across the slices, \fBc1t0d0s0\fR, \fBc1t2d0s0\fR, and \fBc1t3d0s0\fR.
728 \fBExample 8 \fRSoft Partition
731 The following example shows a soft partition device, \fBd1\fR, built on
732 metadevice \fBd100\fR and 100 Mbytes (indicated by \fB100M\fR) in size:
735 .in +2
737 # metainit d1 -p d100 100M
739 .in -2
744 The preceding command creates a 100 Mbyte soft partition on the \fBd100\fR
745 metadevice. This metadevice could be a RAID level 5, stripe, concatenation, or
746 mirror.
749 \fBExample 9 \fRSoft Partition on Full Disk
752 The following example shows a soft partition device, \fBd1\fR, built on disk
753 \fBc3t4d0\fR:
756 .in +2
758 # metainit d1 -p -e c3t4d0 9G
760 .in -2
765 In this example, the disk is repartitioned and a soft partition is defined to
766 occupy all 9 Gbytes of disk \fBc3t4d0s0\fR.
769 \fBExample 10 \fRSoft Partition Taking All Available Space
772 The following example shows a soft partition device, \fBd1\fR, built on disk
773 \fBc3t4d0\fR:
776 .in +2
778 # metainit d1 -p -e c3t4d0 all
780 .in -2
785 In this example, the disk is repartitioned and a soft partition is defined to
786 occupy all available disk space on slice \fBc3t4d0s0\fR.
789 \fBExample 11 \fRHot Spare
792 This example shows a two-way mirror, \fB/dev/md/dsk/d10\fR, and a hot spare
793 pool with three hot spare components. The mirror does not contain any existing
794 data.
797 .in +2
799 # metainit hsp001 c2t2d0s0 c3t2d0s0 c1t2d0s0
800 # metainit d41 1 1 c1t0d0s0 -h hsp001
801 # metainit d42 1 1 c3t0d0s0 -h hsp001
802 # metainit d40 -m d41
803 # metattach d40 d42
805 .in -2
810 In this example, a hot spare pool, \fBhsp001\fR, is created with three slices
811 from three different disks used as hot spares. Next, two submirrors are
812 created, \fBd41\fR and \fBd42\fR. These are simple concatenations. The
813 \fBmetainit\fR command uses the \fB-h\fR option to associate the hot spare pool
814 \fBhsp001\fR with each submirror. A one-way mirror is then defined using the
815 \fB-m\fR option. The second submirror is attached using the \fBmetattach\fR
816 command.
819 \fBExample 12 \fRSetting the Value of the Soft Partition Extent Alignment
822 This example shows how to set the alignment of the soft partition to 1
823 megabyte.
826 .in +2
828 # metainit -s red d13 -p c1t3d0s4 -A 1m 4m
830 .in -2
835 In this example the soft partition, \fBd13\fR, is created with an extent
836 alignment of 1 megabyte. The \fBmetainit\fR command uses the \fB-A\fR option
837 with an alignment of \fB1m\fR to define the soft partition extent alignment.
839 .SH FILES
841 .ne 2
843 \fB\fB/etc/lvm/md.tab\fR\fR
845 .sp .6
846 .RS 4n
847 Contains list of metadevice and hot spare configurations for batch-like
848 creation.
851 .SH WARNINGS
854 This section contains information on different types of warnings.
855 .SS "Devices and Volumes Greater Than 1 TB"
858 Do not create large (>1 TB) volumes if you expect to run the Solaris Operating
859 Environment with a 32-bit kernel or if you expect to use a version of the
860 Solaris Operating Environment prior to Solaris 10.
861 .SS "Multi-Way Mirror"
864 Do not use the \fBmetainit\fR command to create a multi-way mirror. Rather,
865 create a one-way mirror with \fBmetainit\fR then attach additional submirrors
866 with \fBmetattach\fR. When the \fBmetattach\fR command is not used, no resync
867 operations occur and data could become corrupted.
870 If you use \fBmetainit\fR to create a mirror with multiple submirrors, the
871 following message is displayed:
873 .in +2
875 WARNING: This form of metainit is not recommended.
876 The submirrors may not have the same data.
877 Please see ERRORS in metainit(1M) for additional information.
879 .in -2
882 .SS "Truncation of Soft Partitions"
885 When creating stripes on top of soft partitions it is possible for the size of
886 the new stripe to be less than the size of the underlying soft partition. If
887 this occurs, \fBmetainit\fR fails with an error indicating the actions required
888 to overcome the failure.
891 If you use the \fB-f\fR option to override this behavior, the following message
892 is displayed:
894 .in +2
896 WARNING: This form of metainit is not recommended.
897 The stripe is truncating the size of the underlying device.
898 Please see ERRORS in metainit(1M) for additional information.
900 .in -2
903 .SS "Write-On-Write Problem"
906 When mirroring data in Solaris Volume Manager, transfers from memory to the
907 disks do not all occur at exactly the same time for all sides of the mirror. If
908 the contents of buffers are changed while the data is in-flight to the disk
909 (called write-on-write), then different data can end up being stored on each
910 side of a mirror.
913 This problem can be addressed by making a private copy of the data for mirror
914 writes, however, doing this copy is expensive. Another approach is to detect
915 when memory has been modified across a write by looking at the dirty-bit
916 associated with the memory page. Solaris Volume Manager uses this dirty-bit
917 technique when it can. Unfortunately, this technique does not work for raw I/O
918 or direct I/O. By default, Solaris Volume Manager is tuned for performance with
919 the liability that mirrored data might be out of sync if an application does a
920 "write-on-write" to buffers associated with raw I/O or direct I/O. Without
921 mirroring, you were not guaranteed what data would actually end up on media,
922 but multiple reads would return the same data. With mirroring, multiple reads
923 can return different data. The following line can be added to \fB/etc/system\fR
924 to cause a stable copy of the buffers to be used for all raw I/O and direct I/O
925 write operations.
927 .in +2
929 set md_mirror:md_mirror_wow_flg=0x20
931 .in -2
936 Setting this flag degrades performance.
937 .SH EXIT STATUS
940 The following exit values are returned:
942 .ne 2
944 \fB\fB0\fR\fR
946 .sp .6
947 .RS 4n
948 Successful completion.
952 .ne 2
954 \fB\fB>0\fR\fR
956 .sp .6
957 .RS 4n
958 An error occurred.
961 .SH ATTRIBUTES
964 See \fBattributes\fR(5) for descriptions of the following attributes:
969 box;
970 c | c
971 l | l .
972 ATTRIBUTE TYPE  ATTRIBUTE VALUE
974 Interface Stability     Stable
977 .SH SEE ALSO
980 \fBmdmonitord\fR(1M), \fBmetaclear\fR(1M), \fBmetadb\fR(1M),
981 \fBmetadetach\fR(1M), \fBmetahs\fR(1M), \fBmetaoffline\fR(1M),
982 \fBmetaonline\fR(1M), \fBmetaparam\fR(1M), \fBmetarecover\fR(1M),
983 \fBmetarename\fR(1M), \fBmetareplace\fR(1M), \fBmetaroot\fR(1M),
984 \fBmetaset\fR(1M), \fBmetassist\fR(1M), \fBmetastat\fR(1M), \fBmetasync\fR(1M),
985 \fBmetattach\fR(1M), \fBmd.tab\fR(4), \fBmd.cf\fR(4), \fBmddb.cf\fR(4),
986 \fBmd.tab\fR(4), \fBattributes\fR(5), \fBmd\fR(7D)
989 \fI\fR
990 .SH LIMITATIONS
993 Recursive mirroring is not allowed; that is, a mirror cannot appear in the
994 definition of another mirror.
997 Recursive logging is not allowed; that is, a trans metadevice cannot appear in
998 the definition of another metadevice.
1001 Stripes, concatenations, and RAID level 5 metadevices must consist of slices
1002 only.
1005 Mirroring of RAID level 5 metadevices is not allowed.
1008 Soft partitions can be built on raw devices, or on stripes, RAID level 5, or
1009 mirrors.
1012 RAID level 5 or stripe metadevices can be built directly on soft partitions.
1013 .SH NOTES
1016 Trans metadevices have been replaced by UFS logging. Existing trans devices are
1017 \fBnot\fR logging--they pass data directly through to the underlying device.
1018 See \fBmount_ufs\fR(1M) for more information about UFS logging.