1metarename(1M) System Administration Commands metarename(1M)
2
3
4
6 metarename - rename metadevice or switch layered metadevice names
7
9 /usr/sbin/metarename [-s setname] metadevice1 metadevice2
10
11
12 /usr/sbin/metarename [-s setname] [-f] -x metadevice1 metadevice2
13
14
15 /usr/sbin/metarename -h
16
17
19 There are two ways to use metarename, one with and one without the -x
20 option. The first method (without -x) renames an existing metadevice to
21 a new name. This makes managing the metadevice namespace easier. The
22 metadevice being renamed cannot be mounted or open, nor can the new
23 name already exist. For example, to rename a metadevice that contains a
24 mounted file system, you would first need to unmount the file system.
25
26
27 With the second way to use metarename, using the -x option, metarename
28 switches (exchanges) the names of an existing layered metadevice and
29 one of its subdevices. In Solaris Volume Manager terms, a layered
30 metadevice can be either a mirror or a trans metadevice. The -x option
31 enables you to switch the metadevice names of a mirror and one of its
32 submirrors, or a trans metadevice and its master device.
33
34
35 metarename -x makes it easier to mirror or unmirror an existing stripe
36 or concatenation, and to remove a trans device.
37
38
39 When used to mirror an existing stripe or concatenatation, you must
40 stop access to the device. For example, if the device contains a
41 mounted file system, you must first unmount the file system before
42 doing the rename.
43
44
45 You can also use the metarename -x command to untrans a trans metade‐
46 vice from an existing device. This applies only to the master device.
47 You cannot remove a logging device with metarename. Before you can
48 rename a trans device, you must detach the logging device. Then you
49 must stop access to the trans metadevice itself.
50
51
52 You cannot rename or switch metadevices that are in an error state or
53 that have subcomponents in an error state, or metadevices actively
54 using a hot spare replacement.
55
56
57 You can only switch metadevices that have a direct child/parent rela‐
58 tionship. You could not, for example, directly exchange a stripe in a
59 mirror that is a master device with the trans metadevice.
60
61
62 You must use the -f flag when switching members of a trans metadevice.
63
64
65 Only metadevices can be switched, not slices.
66
68 The following options are supported:
69
70 -f Force the switching of trans metadevice members.
71
72
73 -h Display a help message.
74
75
76 -s setname Specifies the name of the diskset on which metarename
77 will work. Using the -s option will cause the command to
78 perform its administrative function within the specified
79 diskset. Without this option, the command will perform
80 its function on the local metadevices.
81
82
83 -x Exchange the metadevice names metadevice1 and metade‐
84 vice2.
85
86
87 metadevice1 Specifies the metadevice to be renamed or switched.
88
89
90 metadevice2 Specifies the target metadevice name for the rename or
91 switch operation.
92
93
95 Example 1 Renaming a Metadevice
96
97
98 This example renames a metadevice named d10 to account_records. Note
99 that account_records must not exist for the rename to succeed.
100
101
102 # metarename d10 account_records
103
104
105
106 Example 2 Creating a Two-Way Mirror
107
108
109 This example creates a two-way mirror from an existing stripe named d1
110 with a mounted file system, /home2.
111
112
113 # metainit d2 1 1 c13d0s1
114 # metainit -f d20 -m d1
115 # umount /home2
116 # metarename -x d20 d1
117 # metattach d1 d2
118 # mount /home2
119
120
121
122
123 First, a second concatenation d2, is created. (d1 already exists.) The
124 metainit command creates a one-way mirror, d20, from d1. Next, you
125 umount the file system and switch d1 for d20, making d1 the top-level
126 device (mirror). You attach the second submirror, d2, to create a two-
127 way mirror. Lastly, you remount the file system.
128
129
130 Example 3 Mounting a Mirrored File System on Stripe
131
132
133 This example takes an existing mirror named d1 with a mounted file sys‐
134 tem, and ends up with the file system mounted on a stripe d1.
135
136
137 # umount /fs2
138 # metarename -x d1 d20
139 # metadetach d20 d1
140 # metaclear -r d20
141 # mount /fs2
142
143
144
145
146 First, you unmount the file system, then switch the mirror d1 and its
147 submirror d20. This makes the mirror into d20. Next, you detach d1 from
148 d20, then delete the mirror d20 and its other submirror. You then
149 remount the file system.
150
151
152 Example 4 Deleting a Trans Metadevice
153
154
155 This example deletes a trans metadevice named d10 while its mount point
156 is /myhome. The master device, which is a stripe, is named d2. The log‐
157 ging device, also a stripe, is named d5.
158
159
160 # umount /myhome
161 # metadetach d10
162 # metarename -f -x d10 d2
163 # metaclear d2
164 # metaclear d5
165 # fsck /dev/md/dsk/d10
166 # mount /myhome
167
168
169
170
171 You umount the file system first, then detach the trans metadevice's
172 logging device. The trans metadevice is switched with the master
173 device, making the trans metadevice d2 and the underlying stripe d10.
174 You clear the trans metadevice d2 and the logging device d5. d10 must
175 be fsck'd, and then the file system is remounted.
176
177
179 The following exit values are returned:
180
181 0 Successful completion.
182
183
184 >0 An error occurred.
185
186
188 See attributes(5) for descriptions of the following attributes:
189
190
191
192
193 ┌─────────────────────────────┬─────────────────────────────┐
194 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
195 ├─────────────────────────────┼─────────────────────────────┤
196 │Availability │SUNWmdu │
197 ├─────────────────────────────┼─────────────────────────────┤
198 │Interface Stability │Stable │
199 └─────────────────────────────┴─────────────────────────────┘
200
202 mdmonitord(1M), metaclear(1M), metadb(1M), metadetach(1M), metahs(1M),
203 metainit(1M), metaoffline(1M), metaonline(1M), metaparam(1M), metare‐
204 cover(1M), metareplace(1M), metaroot(1M), metaset(1M), metassist(1M),
205 metastat(1M), metasync(1M), metattach(1M), md.tab(4), md.cf(4),
206 mddb.cf(4), md.tab(4), attributes(5), md(7D)
207
208
209
210
212 Renaming and exchanging metadevice names can only be used for metade‐
213 vices. A physical slice cannot be renamed to a metadevice, nor can a
214 metadevice be exchanged with a physical slice name.
215
216
217 Metadevice names are strings of the pattern d<xyz> where xyz is a value
218 between 0 and 8192. You cannot use logical names for metadevices.
219
221 Trans metadevices have been replaced by UFS logging. Existing trans
222 devices are not logging--they pass data directly through to the under‐
223 lying device. See mount_ufs(1M) for more information about UFS logging.
224
225
226
227SunOS 5.11 26 Mar 2006 metarename(1M)