1metattach(1M)           System Administration Commands           metattach(1M)
2
3
4

NAME

6       metattach, metadetach - attach or detach a metadevice
7

SYNOPSIS

9       /usr/sbin/metattach [-h]
10
11
12       /usr/sbin/metattach [-s setname] mirror [metadevice]
13
14
15       /usr/sbin/metattach [-s setname] [-i interlace] concat/stripe component...
16
17
18       /usr/sbin/metattach [-s setname] RAID component...
19
20
21       /usr/sbin/metattach [-s setname] [-A alignment] softpart size | all
22
23
24       /usr/sbin/metadetach [-s setname] [-f] mirror submirror
25
26
27       /usr/sbin/metadetach [-s setname] [-f] trans
28
29

DESCRIPTION

31       metattach adds submirrors to a mirror, grows metadevices, or grows soft
32       partitions. Growing metadevices can be done without  interrupting  ser‐
33       vice.  To  grow the size of a mirror or trans, the slices must be added
34       to the submirrors or to the master devices.
35
36
37       Solaris Volume Manager supports storage  devices  and  logical  volumes
38       greater  than  1 terabyte (TB) when a system runs a 64-bit Solaris ker‐
39       nel. Support for large volumes is automatic. If a device greater than 1
40       TB  is  created, Solaris Volume Manager configures it appropriately and
41       without user intervention.
42
43
44       If a system with large volumes is rebooted under a 32-bit Solaris  ker‐
45       nel,  the large volumes are visible through metastat output. Large vol‐
46       umes cannot be accessed, modified or deleted, and no new large  volumes
47       can  be  created. Any volumes or file systems on a large volume in this
48       situation are also unavailable. If  a  system  with  large  volumes  is
49       rebooted  under  a  version  of  Solaris  prior  to  the Solaris 9 4/03
50       release, Solaris Volume Manager does not start.  You  must  remove  all
51       large  volumes before Solaris Volume Manager runs under an earlier ver‐
52       sion of the Solaris Operating System.
53
54
55       Solaris Volume Manager supports one-to-four-way mirrors. You  can  only
56       attach  a metadevice to a mirror if there are three or fewer submirrors
57       beneath the mirror. Once a new metadevice  is  attached  to  a  mirror,
58       metattach automatically starts a resync operation to the new submirror.
59
60
61       metadetach  detaches  submirrors  from mirrors and logging devices from
62       trans metadevices.
63
64
65       When a submirror is detached from a mirror, it is no longer part of the
66       mirror, thus reads and writes to and from that metadevice by way of the
67       mirror are no longer performed through the mirror. Detaching  the  only
68       existing  submirror  is  not  allowed.  Detaching  a submirror that has
69       slices reported as needing maintenance (by  metastat)  is  not  allowed
70       unless the -f (force) flag is used.
71
72
73       metadetach  also detaches the logging device from a trans. This step is
74       necessary before you can clear the trans volume. Trans metadevices have
75       been  replaced  by UFS logging. Existing trans devices are not logging.
76       They  pass  data  directly  through  to  the  underlying  device.   See
77       mount_ufs(1M) for more information about UFS logging.
78
79
80       Detaching  the  logging  device from a busy trans device is not allowed
81       unless the -f (force) flag is used. Even so, the logging device is  not
82       actually  detached until the trans is idle. The trans is in the Detach‐
83       ing state (metastat) until the logging device is detached.
84

OPTIONS

86       Root privileges are required for all of the  following  options  except
87       -h.
88
89
90       The following options are supported:
91
92       -A alignment    Set  the  value of the soft partition extent alignment.
93                       Use this option when it is important specify a starting
94                       offset  for  the  soft partition. It preserves the data
95                       alignment between the metadevice address space and  the
96                       address space of the underlying physical device.
97
98                       For  example,  a hardware device that does checksumming
99                       should not have its I/O  requests  divided  by  Solaris
100                       Volume  Manager.  In  this  case,  use a value from the
101                       hardware configuration as the value for the  alignment.
102                       When  using  this option in conjunction with a software
103                       I/O load, the alignment value corresponds  to  the  I/O
104                       load  of  the application. This prevents I/O from being
105                       divided unnecessarily and affecting performance.
106
107
108       -f              Force the detaching of metadevices that have components
109                       that  need  maintenance  or  are busy. You can use this
110                       option only when a mirror is  in  a  maintenance  state
111                       that  can  be fixed with metareplace(1M). If the mirror
112                       is in a maintenance state that can only be  fixed  with
113                       metasync(1M)  (as shown by the output of metastat(1M)),
114                       metadetach -f has no effect, because the  mirrors  must
115                       be resynchronized before one of them can be detached.
116
117
118       -h              Display a usage message.
119
120
121       -i interlace    Specify  the interlace value for stripes, where size is
122                       a specified value followed by either k for kilobytes, m
123                       for megabytes, or b for blocks. The units can be either
124                       uppercase or lowercase. If size is not  specified,  the
125                       size  defaults to the interlace size of the last stripe
126                       of the metadevice. When an  interlace  size  change  is
127                       made  on a stripe, it is carried forward on all stripes
128                       that follow.
129
130
131       -s setname      Specify the name of the diskset on which the  metattach
132                       command  or the metadetach command works.. Using the -s
133                       option causes the command to perform its administrative
134                       function  within  the  specified  diskset. Without this
135                       option, the command  performs  its  function  on  local
136                       metadevices.
137
138

OPERANDS

140       The following operands are supported:
141
142       component        The logical name for the physical slice (partition) on
143                        a disk drive, such as /dev/dsk/c0t0d0s2,  being  added
144                        to   the   concatenation,   stripe,  concatenation  of
145                        stripes, or RAID5 metadevice.
146
147
148       concat/stripe    The metadevice name of the concatenation,  stripe,  or
149                        concatenation of stripes.
150
151
152       log              The  metadevice  name  of  the  logging  device  to be
153                        attached to the trans metadevice.
154
155
156       metadevice       The metadevice name to be attached to the mirror as  a
157                        submirror.  This  metadevice must have been previously
158                        created by the metainit command.
159
160
161       mirror           The name of the mirror.
162
163
164       RAID             The metadevice name of the RAID5 metadevice.
165
166
167       size | all       The amount of space to add to the soft partition in  K
168                        or  k  for kilobytes, M or m for megabytes, G or g for
169                        gigabytes, T or t for terabytes, and B or b for blocks
170                        (sectors). All values represent powers of 2, and upper
171                        and lower case options are  equivalent.  Only  integer
172                        values  are  permitted. The literal all specifies that
173                        the soft partition should grow to occupy all available
174                        space on the underlying volume.
175
176
177       softpart         The metadevice name of the existing soft partition.
178
179
180       submirror        The  metadevice  name  of the submirror to be detached
181                        from the mirror.
182
183
184       trans            The metadevice name of the trans metadevice  (not  the
185                        master or logging device).
186
187

EXAMPLES

189       Example 1 Concatenating a New Slice to a Metadevice
190
191
192       This example concatenates a single new slice to an existing metadevice,
193       Volume.1. Afterwards, you would use the growfs(1M)  command  to  expand
194       the file system.
195
196
197         # metattach Volume.1 /dev/dsk/c0t1d0s2
198
199
200
201       Example 2 Detaching Logging Device from Trans Metadevice
202
203
204       This  example  detaches  the logging device from a trans metadevice d9.
205       Notice that you do not have to specify the logging  device  itself,  as
206       there can only be one.
207
208
209         # metadetach d9
210
211
212
213       Example 3 Expanding a RAID5 Metadevice
214
215
216       This  example  expands  a  RAID5  metadevice, d45, by attaching another
217       slice.
218
219
220         # metattach d45 /dev/dsk/c3t0d0s2
221
222
223
224
225       When you add additional slices to a RAID5  metadevice,  the  additional
226       space  is devoted to data. No new parity blocks are allocated. The data
227       on the added slices is, however, included in the overall parity  calcu‐
228       lations, so it is protected against single-device failure.
229
230
231       Example 4 Expanding a Soft Partition
232
233
234       The  following  example  expands  a  soft partition, d42, attaching all
235       space available on the underlying device.
236
237
238         # metattach d42 all
239
240
241
242
243       When you add additional space to a soft partition, the additional space
244       is  taken  from  any available space on the slice and might not be con‐
245       tiguous with the existing soft partition.
246
247
248       Example 5 Adding Space to Two-Way Mirror
249
250
251       This example adds space to a two-way mirror by adding a slice  to  each
252       submirror.  Afterwards,  you would use the growfs(1M) command to expand
253       the file system.
254
255
256         # metattach d9 /dev/dsk/c0t2d0s5
257         # metattach d10 /dev/dsk/c0t3d0s5
258
259
260
261
262       This example tells the mirror to grow to the  size  of  the  underlying
263       devices
264
265
266         # metattach d11
267
268
269
270
271       This  example  increases the size of the UFS on the device so the space
272       can be used.
273
274
275         # growfs -M /export /dev/md/rdsk/d11
276
277
278
279       Example 6 Detaching a Submirror from a Mirror
280
281
282       This example detaches a submirror, d2, from a mirror, d4.
283
284
285         # metadetach d4 d2
286
287
288
289       Example 7 Adding Four Slices to Metadevice
290
291
292       This example adds four slices to an  existing  metadevice,  d9.  After‐
293       wards, you would use the growfs(1M) command to expand the file system.
294
295
296         # metattach d9 /dev/dsk/c0t1d0s2 /dev/dsk/c0t2d0s2      /dev/dsk/c0t3d0s2 /dev/dsk/c0t4d0s2
297
298
299
300       Example 8 Setting the Value of the Soft Partition Extent Alignment
301
302
303       This  example  shows  how to set the alignment of the soft partition to
304       1mb when the soft partition is expanded.
305
306
307         # metattach -s red -A 2m d13 1m
308
309
310

EXIT STATUS

312       The following exit values are returned:
313
314       0     Successful completion.
315
316
317       >0    An error occurred.
318
319

ATTRIBUTES

321       See attributes(5) for descriptions of the following attributes:
322
323
324
325
326       ┌─────────────────────────────┬─────────────────────────────┐
327       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
328       ├─────────────────────────────┼─────────────────────────────┤
329       │Availability                 │SUNWmdu                      │
330       ├─────────────────────────────┼─────────────────────────────┤
331       │Interface Stability          │Stable                       │
332       └─────────────────────────────┴─────────────────────────────┘
333

SEE ALSO

335       mdmonitord(1M), metaclear(1M),  metadb(1M),  metahs(1M),  metainit(1M),
336       metaoffline(1M),    metaonline(1M),   metaparam(1M),   metarecover(1M),
337       metarename(1M),  metareplace(1M),  metaroot(1M),  metaset(1M),   metas‐
338       sist(1M),  metastat(1M), metasync(1M), md.tab(4), md.cf(4), mddb.cf(4),
339       md.tab(4), attributes(5), md(7D)
340
341
342
343

WARNINGS

345       This  section  provides  information  regarding  warnings  for  devices
346       greater than 1 TB and for multi-way mirrors.
347
348   Devices and Volumes Greater Than 1 TB
349       Do  not  create  large (>1 TB) volumes if you expect to run the Solaris
350       Operating System with a 32-bit kernel or if you expect to use a version
351       of the Solaris Operating System prior to Solaris 9 4/03.
352
353   Multi-Way Mirrors
354       When  a  submirror is detached from its mirror, the data on the metade‐
355       vice might not be the same as the data that existed on the mirror prior
356       to  running metadetach. In particular, if the -f option was needed, the
357       metadevice and mirror probably do not contain the same data.
358

NOTES

360       Trans metadevices have been replaced by  UFS  logging.  Existing  trans
361       devices  are not logging. They pass data directly through to the under‐
362       lying device. See mount_ufs(1M) for more information about UFS logging.
363
364
365
366SunOS 5.11                        20 Jun 2006                    metattach(1M)
Impressum