1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
|
'\" 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 METAINIT 1M "Mar 27, 2006"
.SH NAME
metainit \- configure metadevices
.SH SYNOPSIS
.LP
.nf
\fB/sbin/metainit\fR \fB-h\fR
.fi
.LP
.nf
\fB/sbin/metainit\fR [\fIgeneric options\fR] \fIconcat/stripe\fR \fInumstripes\fR \fIwidth\fR
\fIcomponent...\fR [\fB-i\fR \fIinterlace\fR]
.fi
.LP
.nf
\fB/sbin/metainit\fR [\fIwidth\fR \fIcomponent...\fR [\fB-i\fR \fIinterlace\fR]]
[\fB-h\fR \fIhot_spare_pool\fR]
.fi
.LP
.nf
\fB/sbin/metainit\fR [\fIgeneric options\fR] \fImirror\fR \fB-m\fR \fIsubmirror\fR
[\fIread_options\fR] [\fIwrite_options\fR]
[\fIpass_num\fR]
.fi
.LP
.nf
\fB/sbin/metainit\fR [\fIgeneric options\fR] \fIRAID\fR \fB-r\fR \fIcomponent...\fR
[\fB-i\fR \fIinterlace\fR]
[\fB-h\fR \fIhot_spare_pool\fR] [\fB-k\fR] [\fB-o\fR \fIoriginal_column_count\fR]
.fi
.LP
.nf
\fB/sbin/metainit\fR [\fIgeneric options\fR] \fIhot_spare_pool\fR
[\fIhotspare...\fR]
.fi
.LP
.nf
\fB/sbin/metainit\fR [\fIgeneric options\fR] \fImetadevice-name\fR
.fi
.LP
.nf
\fB/sbin/metainit\fR [\fIgeneric options\fR] \fB-a\fR
.fi
.LP
.nf
\fB/sbin/metainit\fR [\fIgeneric options\fR] \fIsoftpart\fR \fB-p\fR [\fB-e\fR] \fIcomponent\fR
[\fB-A\fR \fIalignment\fR] \fIsize\fR
.fi
.LP
.nf
\fB/sbin/metainit\fR \fB-r\fR
.fi
.SH DESCRIPTION
.sp
.LP
The \fBmetainit\fR command configures metadevices and hot spares according to
the information specified on the command line. Alternatively, you can run
\fBmetainit\fR so that it uses configuration entries you specify in the
\fB/etc/lvm/md.tab\fR file (see \fBmd.tab\fR(4)). All metadevices must be set
up by the \fBmetainit\fR command before they can be used.
.sp
.LP
Solaris Volume Manager supports storage devices and logical volumes greater
than 1 terabyte (TB) when a system runs a 64-bit Solaris kernel. Support for
large volumes is automatic. If a device greater than 1 TB is created, Solaris
Volume Manager configures it appropriately and without user intervention.
.sp
.LP
If a system with large volumes is rebooted under a 32-bit Solaris kernel, the
large volumes are visible through \fBmetastat\fR output. Large volumes cannot
be accessed, modified or deleted, and no new large volumes can be created. Any
volumes or file systems on a large volume in this situation are unavailable. If
a system with large volumes is rebooted under a version of Solaris prior to the
Solaris 9 4/03 release, Solaris Volume Manager does not start. You must remove
all large volumes before Solaris Volume Manager runs under an earlier version
of the Solaris Operating System.
.sp
.LP
If you edit the \fB/etc/lvm/md.tab\fR file to configure metadevices, specify
one complete configuration entry per line. You then run the \fBmetainit\fR
command with either the \fB-a\fR option, to activate all metadevices you
entered in the \fB/etc/lvm/md.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.
Any volumes in \fBmd.tab\fR that have dependencies on other volumes in
\fBmd.tab\fR are reported as errors when \fBmetainit\fR \fB-a\fR \fB-n\fR is
run, although the operations might succeed when \fBmetainit\fR \fB-a\fR is run.
See \fBmd.tab\fR(4).
.sp
.LP
Solaris Volume Manager never updates the \fB/etc/lvm/md.tab\fR file. Complete
configuration information is stored in the metadevice state database, not
\fBmd.tab\fR. The only way information appears in \fBmd.tab\fR is through
editing it by hand.
.sp
.LP
When setting up a disk mirror, the \fBfirst\fR step is to use \fBmetainit\fR
create a one-on-one concatenation for the root slice. See \fBEXAMPLES\fR.
.SH OPTIONS
.sp
.LP
The following options are supported:
.SS "Generic Options"
.sp
.LP
Root privileges are required for all of the following options except \fB-h\fR.
.sp
.LP
The following generic options are supported:
.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.sp .6
.RS 4n
Forces the \fBmetainit\fR command to continue even if one of the slices
contains a mounted file system or is being used as \fBswap\fR, or if the stripe
being created is smaller in size than the underlying soft partition. This
option is required when configuring mirrors on root (\fB/\fR), \fBswap\fR, and
\fB/usr\fR.
.RE
.sp
.ne 2
.na
\fB\fB-h\fR\fR
.ad
.sp .6
.RS 4n
Displays usage message.
.RE
.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.sp .6
.RS 4n
Checks the syntax of your command line or \fBmd.tab\fR entry without actually
setting up the metadevice. If used with \fB-a\fR, all devices are checked but
not initialized.
.RE
.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.sp .6
.RS 4n
Only used in a shell script at boot time. Sets up all metadevices that were
configured before the system crashed or was shut down. The information about
previously configured metadevices is stored in the metadevice state database
(see \fBmetadb\fR(1M)).
.RE
.sp
.ne 2
.na
\fB\fB-s\fR \fB\fIsetname\fR\fR\fR
.ad
.sp .6
.RS 4n
Specifies the name of the diskset on which \fBmetainit\fR works. Without the
\fB-s\fR option, the \fBmetainit\fR command operates on your local metadevices
and/or hotspares.
.RE
.SS "Concat/Stripe Options"
.sp
.LP
The following concat/stripe options are supported:
.sp
.ne 2
.na
\fB\fIconcat/stripe\fR\fR
.ad
.sp .6
.RS 4n
Specifies the metadevice name of the concatenation, stripe, or concatenation of
stripes being defined.
.RE
.sp
.ne 2
.na
\fB\fInumstripes\fR\fR
.ad
.sp .6
.RS 4n
Specifies the number of individual stripes in the metadevice. For a simple
stripe, \fInumstripes\fR is always 1. For a concatenation, \fInumstripes\fR is
equal to the number of slices. For a concatenation of stripes, \fInumstripes\fR
varies according to the number of stripes.
.RE
.sp
.ne 2
.na
\fB\fIwidth\fR\fR
.ad
.sp .6
.RS 4n
Specifies the number of slices that make up a stripe. When \fIwidth\fR is
greater than 1, the slices are striped.
.RE
.sp
.ne 2
.na
\fB\fIcomponent\fR\fR
.ad
.sp .6
.RS 4n
The logical name for the physical slice (partition) on a disk drive, such as
\fB/dev/dsk/c0t0d0s0\fR. For RAID level 5 metadevices, a minimum of three
slices is necessary to enable striping of the parity information across slices.
.RE
.sp
.ne 2
.na
\fB\fB-i\fR \fB\fIinterlace\fR\fR\fR
.ad
.sp .6
.RS 4n
Specifies the interlace size. This value tells Solaris Volume Manager how much
data to place on a slice of a striped or RAID level 5 metadevice before moving
on to the next slice. \fIinterlace\fR is a specified value, followed by either
`\fBk\fR' for kilobytes, `\fBm\fR' for megabytes, or `\fBb\fR' for blocks. The
characters can be either uppercase or lowercase. The \fIinterlace\fR specified
cannot be less than 16 blocks, or greater than 100 megabytes. If
\fIinterlace\fR is not specified, it defaults to 512 kilobytes.
.RE
.sp
.ne 2
.na
\fB\fB-h\fR \fB\fIhot_spare_pool\fR\fR\fR
.ad
.sp .6
.RS 4n
Specifies the \fIhot_spare_pool\fR to be associated with the metadevice. If you
use the command line, the hot spare pool must have been previously created by
the \fBmetainit\fR command before it can be associated with a metadevice. Use
\fB/-h\fR \fBhsp\fR\fInnn\fR when the concat/stripe being created is to be used
as a submirror.
.sp
Names for hot spare pools can be any legal file name that is composed of
alphanumeric characters, a dash ("-"), an underscore ("_"), or a period (".").
Names must begin with a letter. The words "all" and "none" are reserved and
cannot be used.
.RE
.SS "Mirror Options"
.sp
.LP
The following mirror options are supported:
.sp
.ne 2
.na
\fB\fImirror\fR \fB-m\fR \fI\fR\fIsubmirror\fR\fI\fR\fR
.ad
.sp .6
.RS 4n
Specifies the metadevice name of the mirror. The \fB-m\fR indicates that the
configuration is a mirror. \fIsubmirror\fR is a metadevice (stripe or
concatentation) that makes up the initial one-way mirror. Solaris Volume
Manager supports a maximum of four-way mirroring. When defining mirrors, first
create the mirror with the \fBmetainit\fR command as a one-way mirror. Then
attach subsequent submirrors using the \fBmetattach\fR command. This method
ensures that Solaris Volume Manager properly syncs the mirrors. (The second and
any subsequent submirrors are first created using the \fBmetainit\fR command.)
.RE
.sp
.ne 2
.na
\fB\fIread_options\fR\fR
.ad
.sp .6
.RS 4n
The following read options for mirrors are supported:
.sp
.ne 2
.na
\fB\fB-g\fR\fR
.ad
.sp .6
.RS 4n
Enables the geometric read option, which results in faster performance on
sequential reads.
.RE
.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.sp .6
.RS 4n
Directs all reads to the first submirror. This should only be used when the
devices comprising the first submirror are substantially faster than those of
the second mirror. This flag cannot be used with the \fB-g\fR flag.
.RE
If neither the \fB-g\fR nor \fB-r\fR flags are specified, reads are made in a
round-robin order from all submirrors in the mirror. This enables load
balancing across the submirrors.
.RE
.sp
.ne 2
.na
\fB\fIwrite_options\fR\fR
.ad
.sp .6
.RS 4n
The following write options for mirrors are supported:
.sp
.ne 2
.na
\fB\fB-S\fR\fR
.ad
.sp .6
.RS 4n
Performs serial writes to mirrors. The first submirror write completes before
the second is started. This can be useful if hardware is susceptible to partial
sector failures. If \fB-S\fR is not specified, writes are replicated and
dispatched to all mirrors simultaneously.
.RE
.RE
.sp
.ne 2
.na
\fB\fIpass_num\fR\fR
.ad
.sp .6
.RS 4n
A number in the range 0-9 at the end of an entry defining a mirror that
determines the order in which that mirror is resynced during a reboot. The
default is 1. Smaller pass numbers are resynced first. Equal pass numbers are
run concurrently. If 0 is used, the resync is skipped. 0 should be used only
for mirrors mounted as read-only, or as \fBswap\fR.
.RE
.SS "RAID Level 5 Options"
.sp
.LP
The following RAID level 5 options are available:
.sp
.ne 2
.na
\fB\fIRAID\fR \fB-r\fR\fR
.ad
.sp .6
.RS 4n
Specifies the name of the RAID level 5 metadevice. The \fB-r\fR specifies that
the configuration is RAID level 5.
.RE
.sp
.ne 2
.na
\fB\fB-k\fR\fR
.ad
.sp .6
.RS 4n
For RAID level 5 metadevices, informs the driver that it is not to initialize
(zero the disk blocks) due to existing data. Only use this option to recreate a
previously created RAID level 5 device.
.sp
Use the \fB-k\fR option with extreme caution. This option sets the disk blocks
to the \fBOK\fR state. If any errors exist on disk blocks within the
metadevice, Solaris Volume Manager might begin fabricating data. Instead of
using the \fB-k\fR option, you might want to initialize the device and restore
data from tape.
.RE
.sp
.ne 2
.na
\fB\fB-o\fR \fB\fIoriginal_column_count\fR\fR\fR
.ad
.sp .6
.RS 4n
For RAID level 5 metadevices, used with the \fB-k\fR option to define the
number of original slices in the event the originally defined metadevice was
grown. This is necessary since the parity segments are not striped across
concatenated devices.
.sp
Use the \fB-o\fR option with extreme caution. This option sets the disk blocks
to the \fBOK\fR state. If any errors exist on disk blocks within the
metadevice, Solaris Volume Manager might begin fabricating data. Instead of
using the \fB-o\fR option, you might want to initialize the device and restore
data from tape.
.RE
.SS "Soft Partition Options"
.sp
.LP
The following soft partition options are supported:
.sp
.ne 2
.na
\fB\fIsoftpart\fR \fB-p\fR [\fB-e\fR] \fIcomponent\fR [\fB-A\fR
\fIalignment\fR] \fIsize\fR\fR
.ad
.sp .6
.RS 4n
The \fIsoftpart\fR argument specifies the name of the soft partition. The
\fB-p\fR specifies that the configuration is a soft partition.
.sp
The \fB-e\fR specifies that the entire disk specified by \fIcomponent\fR as
\fBc*t*d*\fR should be repartitioned and reserved for soft partitions. The
specified component is repartitioned such that slice 7 reserves space for
system (state database replica) usage and slice 0 contains all remaining space
on the disk. Slice 7 is a minimum of 4MB, but can be larger, depending on the
disk geometry. The newly created soft partition is placed on slice 0 of the
device.
.sp
The \fIcomponent\fR argument specifies the disk (\fBc*t*d*\fR), slice
(\fBc*t*d*s*\fR), or meta device (\fBd*\fR) from which to create the soft
partition. The \fIsize\fR argument determines the space to use for the soft
partition and can be specified in \fBK\fR or \fBk\fR for kilobytes, \fBM\fR or
\fBm\fR for megabytes, \fBG\fR or \fBg\fR for gigabytes, \fBT\fR or \fBt\fR for
terabyte (one terabyte is the maximum size), and \fBB\fR or \fBb\fR for blocks
(sectors). All values represent powers of 2, and upper and lower case options
are equivalent. Only integer values are permitted.
.sp
The \fB-A\fR alignment option sets the value of the soft partition extent
alignment. This option used when it is important specify a starting offset for
the soft partition. It preserves the data alignment between the metadevice
address space and the address space of the underlying physical device. For
example, a hardware device that does checksumming should not have its I/O
requests divided by Solaris Volume Manager. In this case, use a value from the
hardware configuration as the value for the alignment. When you use this option
in conjunction with a software I/O load, the alignment value corresponds to the
I/O load of the application. This prevents I/O from being divided unnecessarily
and affecting performance.
.sp
The literal \fBall\fR, used instead of specifying size, specifies that the soft
partition should occupy all available space on the device.
.RE
.SS "Hot Spare Pool Options"
.sp
.LP
The following hot spare pool options are supported:
.sp
.ne 2
.na
\fB\fIhot_spare_pool\fR \fI\fR\fB[\fR\fI\fR \fI\fR\fIhotspare...\fR\fI\fR
\fI\fR\fB]\fR\fI\fR\fR
.ad
.sp .6
.RS 4n
When used as arguments to the \fBmetainit\fR command, \fIhot_spare_pool\fR
defines the name for a hot spare pool, and \fIhotspare...\fR is the logical
name for the physical slice(s) for availability in that pool. Names for hot
spare pools can be any legal file name that is composed of alphanumeric
characters, a dash ("-"), an underscore ("_"), or a period ("."). Names must
begin with a letter. The words "all" and "none" are reserved and cannot be
used.
.RE
.SS "\fBmd.tab\fR File Options"
.sp
.LP
The following \fBmd.tab\fR file options are supported:
.sp
.ne 2
.na
\fB\fImetadevice-name\fR\fR
.ad
.sp .6
.RS 4n
When the \fBmetainit\fR command is run with a \fImetadevice-name\fR as its only
argument, it searches the \fB/etc/lvm/md.tab\fR file to find that name and its
corresponding entry. The order in which entries appear in the \fBmd.tab\fR file
is unimportant. For example, consider the following \fBmd.tab\fR entry:
.sp
.in +2
.nf
d0 2 1 c1t0d0s0 1 c2t1d0s0
.fi
.in -2
.sp
When you run the command \fBmetainit d0\fR, it configures metadevice \fBd0\fR
based on the configuration information found in the \fBmd.tab\fR file.
.RE
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.sp .6
.RS 4n
Activates all metadevices defined in the \fBmd.tab\fR file.
.sp
\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
fails when \fBmetainit\fR \fB-an\fR runs (even if it would succeed with
\fBmetainit\fR \fB-a\fR).
.RE
.SH EXAMPLES
.LP
\fBExample 1 \fRCreating a One-on-One Concatenation
.sp
.LP
The following command creates a one-on-one concatenation for the root slice.
This is the first step you take when setting up a mirror for the root slice
(and any other slice that cannot be unmounted). The \fB-f\fR option is required
to create a volume with an existing file system, such as root(\fB/\fR).
.sp
.in +2
.nf
# metainit \fB-f\fR dl 1 1 c0t0d0s0
.fi
.in -2
.sp
.sp
.LP
The preceding command makes \fBd1\fR a one-on-one concatenation, using the root
slice. You can then enter:
.sp
.in +2
.nf
# metainit d0 -m d1
.fi
.in -2
.sp
.sp
.LP
\&...to make a one-way mirror of the root slice.
.LP
\fBExample 2 \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 slices.
.sp
.in +2
.nf
# metainit d7 4 1 c0t1d0s0 1 c0t2d0s0 1 c0t3d0s0 1 /dev/dsk/c0t4d0s0
.fi
.in -2
.sp
.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. The first disk sector in all of these 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. Because skipping only the first sector would create
an irregular disk geometry, the entire first cylinder of these disks is
skipped. This allows higher level file system software to optimize block
allocations correctly.
.LP
\fBExample 3 \fRStripe
.sp
.LP
This example shows a metadevice, \fB/dev/md/dsk/d15\fR, consisting of two
slices.
.sp
.in +2
.nf
# metainit d15 1 2 c0t1d0s0 c0t2d0s0 -i 32k
.fi
.in -2
.sp
.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 as 32 Kbytes. If the interlace size
were not specified, the stripe would use the default value of 16 Kbytes.
.LP
\fBExample 4 \fRConcatentation 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
# metainit d75 2 3 c0t1d0s0 c0t2d0s0 \e
c0t3d0s0 -i 16k \e
3 c1t1d0s0 c1t2d0s0 c1t3d0s0 -i 32k
.fi
.in -2
.sp
.sp
.LP
On the first line, the \fB-i\fR followed by 16k specifies that the stripe
interlace size is 16 Kbytes. The second set specifies the stripe interlace size
as 32 Kbytes. If the second set did not specify 32 Kbytes, the set would use
the default interlace value of 16 Kbytes. The blocks of each set of three disks
are interlaced across three disks.
.LP
\fBExample 5 \fRMirroring
.sp
.LP
This example shows a two-way mirror, \fB/dev/md/dsk/d50\fR, consisting of two
submirrors. This mirror does not contain any existing data.
.sp
.in +2
.nf
# metainit d51 1 1 c0t1d0s0
# metainit d52 1 1 c0t2d0s0
# metainit d50 -m d51
# metattach d50 d52
.fi
.in -2
.sp
.sp
.LP
In this example, two submirrors, \fBd51\fR and \fBd52\fR, are created with the
\fBmetainit\fR command. These two submirrors are simple concatenations. Next, a
one-way mirror, \fBd50\fR, is created using the \fB-m\fR option with \fBd51\fR.
The second submirror is attached later using the \fBmetattach\fR command. When
creating a mirror, any combination of stripes and concatenations can be used.
The default read and write options in this example are a round-robin read
algorithm and parallel writes to all submirrors.
.LP
\fBExample 6 \fRCreating a metadevice in a diskset
.sp
.LP
This example shows a metadevice, \fB/dev/md/dsk/d75\fR, consisting of a
concatenation of two stripes within a diskset called \fBset1\fR.
.sp
.in +2
.nf
# metainit -s set1 d75 2 3 c2t1d0s0 c2t2d0s0 \e
c2t3d0s0 -i 32k
# metainit -s set1 d51 1 1 c2t1d0s0
# metainit -s set1 d52 1 1 c3t1d0s0
# metainit -s set1 d50 -m d51
# metattach -s set1 d50 d52
.fi
.in -2
.sp
.sp
.LP
In this example, a diskset is created using the \fBmetaset\fR command.
Metadevices are then created within the diskset using the \fBmetainit\fR
command. The two submirrors, \fBd51\fR and \fBd52\fR, are simple
concatenations. Next, a one-way mirror, \fBd50\fR, is created using the
\fB-m\fR option with \fBd51\fR. The second submirror is attached later using
the \fBmetattach\fR command. When creating a mirror, any combination of stripes
and concatenations can be used. The default read and write options in this
example are a round-robin read algorithm and parallel writes to all submirrors.
.LP
\fBExample 7 \fRRAID Level 5
.sp
.LP
This example shows a RAID level 5 device, \fBd80\fR, consisting of three
slices:
.sp
.in +2
.nf
# metainit d80 -r c1t0d0s0 c1t1d0s0 c1t3d0s0 -i 20k
.fi
.in -2
.sp
.sp
.LP
In this example, a RAID level 5 metadevice is defined using the \fB-r\fR option
with an interlace size of 20 Kbytes. The data and parity segments are striped
across the slices, \fBc1t0d0s0\fR, \fBc1t2d0s0\fR, and \fBc1t3d0s0\fR.
.LP
\fBExample 8 \fRSoft Partition
.sp
.LP
The following example shows a soft partition device, \fBd1\fR, built on
metadevice \fBd100\fR and 100 Mbytes (indicated by \fB100M\fR) in size:
.sp
.in +2
.nf
# metainit d1 -p d100 100M
.fi
.in -2
.sp
.sp
.LP
The preceding command creates a 100 Mbyte soft partition on the \fBd100\fR
metadevice. This metadevice could be a RAID level 5, stripe, concatenation, or
mirror.
.LP
\fBExample 9 \fRSoft Partition on Full Disk
.sp
.LP
The following example shows a soft partition device, \fBd1\fR, built on disk
\fBc3t4d0\fR:
.sp
.in +2
.nf
# metainit d1 -p -e c3t4d0 9G
.fi
.in -2
.sp
.sp
.LP
In this example, the disk is repartitioned and a soft partition is defined to
occupy all 9 Gbytes of disk \fBc3t4d0s0\fR.
.LP
\fBExample 10 \fRSoft Partition Taking All Available Space
.sp
.LP
The following example shows a soft partition device, \fBd1\fR, built on disk
\fBc3t4d0\fR:
.sp
.in +2
.nf
# metainit d1 -p -e c3t4d0 all
.fi
.in -2
.sp
.sp
.LP
In this example, the disk is repartitioned and a soft partition is defined to
occupy all available disk space on slice \fBc3t4d0s0\fR.
.LP
\fBExample 11 \fRHot Spare
.sp
.LP
This example shows a two-way mirror, \fB/dev/md/dsk/d10\fR, and a hot spare
pool with three hot spare components. The mirror does not contain any existing
data.
.sp
.in +2
.nf
# metainit hsp001 c2t2d0s0 c3t2d0s0 c1t2d0s0
# metainit d41 1 1 c1t0d0s0 -h hsp001
# metainit d42 1 1 c3t0d0s0 -h hsp001
# metainit d40 -m d41
# metattach d40 d42
.fi
.in -2
.sp
.sp
.LP
In this example, a hot spare pool, \fBhsp001\fR, is created with three slices
from three different disks used as hot spares. Next, two submirrors are
created, \fBd41\fR and \fBd42\fR. These are simple concatenations. The
\fBmetainit\fR command uses the \fB-h\fR option to associate the hot spare pool
\fBhsp001\fR with each submirror. A one-way mirror is then defined using the
\fB-m\fR option. The second submirror is attached using the \fBmetattach\fR
command.
.LP
\fBExample 12 \fRSetting the Value of the Soft Partition Extent Alignment
.sp
.LP
This example shows how to set the alignment of the soft partition to 1
megabyte.
.sp
.in +2
.nf
# metainit -s red d13 -p c1t3d0s4 -A 1m 4m
.fi
.in -2
.sp
.sp
.LP
In this example the soft partition, \fBd13\fR, is created with an extent
alignment of 1 megabyte. The \fBmetainit\fR command uses the \fB-A\fR option
with an alignment of \fB1m\fR to define the soft partition extent alignment.
.SH FILES
.sp
.ne 2
.na
\fB\fB/etc/lvm/md.tab\fR\fR
.ad
.sp .6
.RS 4n
Contains list of metadevice and hot spare configurations for batch-like
creation.
.RE
.SH WARNINGS
.sp
.LP
This section contains information on different types of warnings.
.SS "Devices and Volumes Greater Than 1 TB"
.sp
.LP
Do not create large (>1 TB) volumes if you expect to run the Solaris Operating
Environment with a 32-bit kernel or if you expect to use a version of the
Solaris Operating Environment prior to Solaris 10.
.SS "Multi-Way Mirror"
.sp
.LP
Do not use the \fBmetainit\fR command to create a multi-way mirror. Rather,
create a one-way mirror with \fBmetainit\fR then attach additional submirrors
with \fBmetattach\fR. When the \fBmetattach\fR command is not used, no resync
operations occur and data could become corrupted.
.sp
.LP
If you use \fBmetainit\fR to create a mirror with multiple submirrors, the
following message is displayed:
.sp
.in +2
.nf
WARNING: This form of metainit is not recommended.
The submirrors may not have the same data.
Please see ERRORS in metainit(1M) for additional information.
.fi
.in -2
.sp
.SS "Truncation of Soft Partitions"
.sp
.LP
When creating stripes on top of soft partitions it is possible for the size of
the new stripe to be less than the size of the underlying soft partition. If
this occurs, \fBmetainit\fR fails with an error indicating the actions required
to overcome the failure.
.sp
.LP
If you use the \fB-f\fR option to override this behavior, the following message
is displayed:
.sp
.in +2
.nf
WARNING: This form of metainit is not recommended.
The stripe is truncating the size of the underlying device.
Please see ERRORS in metainit(1M) for additional information.
.fi
.in -2
.sp
.SS "Write-On-Write Problem"
.sp
.LP
When mirroring data in Solaris Volume Manager, transfers from memory to the
disks do not all occur at exactly the same time for all sides of the mirror. If
the contents of buffers are changed while the data is in-flight to the disk
(called write-on-write), then different data can end up being stored on each
side of a mirror.
.sp
.LP
This problem can be addressed by making a private copy of the data for mirror
writes, however, doing this copy is expensive. Another approach is to detect
when memory has been modified across a write by looking at the dirty-bit
associated with the memory page. Solaris Volume Manager uses this dirty-bit
technique when it can. Unfortunately, this technique does not work for raw I/O
or direct I/O. By default, Solaris Volume Manager is tuned for performance with
the liability that mirrored data might be out of sync if an application does a
"write-on-write" to buffers associated with raw I/O or direct I/O. Without
mirroring, you were not guaranteed what data would actually end up on media,
but multiple reads would return the same data. With mirroring, multiple reads
can return different data. The following line can be added to \fB/etc/system\fR
to cause a stable copy of the buffers to be used for all raw I/O and direct I/O
write operations.
.sp
.in +2
.nf
set md_mirror:md_mirror_wow_flg=0x20
.fi
.in -2
.sp
.sp
.LP
Setting this flag degrades performance.
.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.sp .6
.RS 4n
Successful completion.
.RE
.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.sp .6
.RS 4n
An error occurred.
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Stable
.TE
.SH SEE ALSO
.sp
.LP
\fBmdmonitord\fR(1M), \fBmetaclear\fR(1M), \fBmetadb\fR(1M),
\fBmetadetach\fR(1M), \fBmetahs\fR(1M), \fBmetaoffline\fR(1M),
\fBmetaonline\fR(1M), \fBmetaparam\fR(1M), \fBmetarecover\fR(1M),
\fBmetarename\fR(1M), \fBmetareplace\fR(1M), \fBmetaroot\fR(1M),
\fBmetaset\fR(1M), \fBmetassist\fR(1M), \fBmetastat\fR(1M), \fBmetasync\fR(1M),
\fBmetattach\fR(1M), \fBmd.tab\fR(4), \fBmd.cf\fR(4), \fBmddb.cf\fR(4),
\fBmd.tab\fR(4), \fBattributes\fR(5), \fBmd\fR(7D)
.sp
.LP
\fI\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; that is, a trans metadevice cannot appear in
the definition of another metadevice.
.sp
.LP
Stripes, concatenations, and RAID level 5 metadevices must consist of slices
only.
.sp
.LP
Mirroring of RAID level 5 metadevices is not allowed.
.sp
.LP
Soft partitions can be built on raw devices, or on stripes, RAID level 5, or
mirrors.
.sp
.LP
RAID level 5 or stripe metadevices can be built directly on soft partitions.
.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.
|