1 .\" Copyright (c) 2005 Chris Jones
2 .\" All rights reserved.
4 .\" This software was developed for the FreeBSD Project by Chris Jones
5 .\" thanks to the support of Google's Summer of Code program and
6 .\" mentoring by Lukas Ertl.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd Logical Volume Manager control program
35 .Sh DEPRECATION NOTICE
39 kernel support is deprecated, and may not be available in
42 Users are advised to migrate to
49 More information is available at
50 .Pa https://wiki.freebsd.org/DeprecationPlan/gvinum .
56 .Bl -tag -width indent
57 .It Ic attach Ar plex volume Op Cm rename
58 .It Ic attach Ar subdisk plex Oo Ar offset Oc Op Cm rename
59 Attach a plex to a volume, or a subdisk to a plex.
60 If offset is specified, the subdisk will be attached to the given offset within
62 If rename is specified, the subdisk or plex will change name according to the
63 object it attaches to.
64 .It Ic checkparity Oo Fl f Oc Ar plex
65 Check the parity blocks of a RAID-5 plex.
66 The parity check will start at the
67 beginning of the plex if the
69 flag is specified, or otherwise at the location of the parity check pointer,
70 the first location at which plex's parity is incorrect.
72 plex must be up for a parity check.
73 .It Ic concat Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives
74 Create a concatenated volume from the specified drives.
75 If no name is specified, a unique name will be set by
77 .It Ic create Oo Fl f Oc Op Ar description-file
78 Create a volume as described in
79 .Ar description-file .
82 provided, opens an editor and provides the current
84 configuration for editing.
87 flag will make gvinum ignore any errors regarding creating objects that already
89 However, in contrast to vinum, objects that are not properly named in the
91 will not be created when the
94 .It Ic detach Oo Fl f Oc Op Ar plex | subdisk
95 Detach a plex or subdisk from the volume or plex to which it is
97 .It Ic grow Ar plex device
98 Grow a plex by creating a gvinum drive and subdisk on device and attach it to
100 If required by the plex organization, it will be put into the growable state.
102 Provides a synopsis of
104 commands and arguments.
105 .It Ic l | list Oo Fl rvV Oc Op Ar volume | plex | subdisk
106 .It Ic ld Oo Fl rvV Oc Op Ar drive ...
107 .It Ic ls Oo Fl rvV Oc Op Ar subdisk ...
108 .It Ic lp Oo Fl rvV Oc Op Ar plex ...
109 .It Ic lv Oo Fl rvV Oc Op Ar volume ...
110 List information about the relevant object(s).
113 flag provides recursive display, showing each object's subordinate objects in
119 flags provide progressively more detailed output.
120 .It Ic mirror Oo Fl fsv Oc Oo Fl n Ar name Oc Ar drives
121 Create a mirrored volume from the specified drives.
122 It requires at least a multiple of 2 drives.
123 If no name is specified, a unique name will be set by gvinum.
126 flag is specified, a striped mirror will be created, and thus requires a
127 multiple of 4 drives.
128 .It Ic move | mv Fl f Ar drive subdisk Op Ar ...
129 Move the subdisk(s) to the specified drive.
132 flag is required, as all data on the indicated subdisk(s) will be destroyed as
134 This can currently only be done when the subdisk is
137 If a single subdisk is moved, and it forms a part of a RAID-5 plex, the moved
138 subdisks will need to be set to the
140 state, and the plex will require a
143 If multiple subdisk(s) is moved, and form part of a RAID-5 plex, the
144 moved disk(s) will need to be set to the
146 state and the plex will require a
149 If the subdisk(s) form part of a plex that is mirrored with other
150 plexes, the plex will require restarting and will sync once restarted.
152 more than one subdisk in a RAID-5 plex or subdisks from both sides of a
153 mirrored plex volume will destroy data.
154 Note that parity rebuilds and syncing
155 must be started manually after a move.
157 Write a copy of the current configuration to standard output.
161 when running in interactive mode.
162 Normally this would be done by entering the
164 .It Ic raid5 Oo Fl fv Oc Oo Fl s Ar stripesize Oc Oo Fl n Ar name Oc Ar drives
165 Create a RAID-5 volume from the specified drives.
166 If no name is specified, a unique name will be set by
168 This organization requires at least three drives.
169 .It Ic rename Oo Fl r Oc Ar drive | subdisk | plex | volume newname
170 Change the name of the specified object.
173 flag will recursively rename subordinate objects.
175 Note that device nodes will not be renamed until
178 .It Ic rebuildparity Oo Fl f Oc Ar plex
179 Rebuild the parity blocks of a RAID-5 plex.
180 The parity rebuild will start at
181 the beginning of the plex if the
183 flag is specified, or otherwise at the location of the parity check pointer.
184 All subdisks in the plex must be up for a parity check.
185 .It Ic resetconfig Oo Fl f Oc
189 .It Ic rm Oo Fl r Oc Ar volume | plex | subdisk
190 Remove an object and, if
192 is specified, its subordinate objects.
196 configuration to disk after configuration failures.
197 .It Ic setstate Oo Fl f Oc Ar state volume | plex | subdisk | drive
198 Set state without influencing other objects, for diagnostic purposes
202 flag forces state changes regardless of whether they are legal.
204 Read configuration from all vinum drives.
205 .It Ic start Oo Fl S Ar size Oc Ar volume | plex | subdisk
206 Allow the system to access the objects.
207 If necessary, plexes will be synced and rebuilt.
208 If a subdisk was added to a running RAID-5 or striped plex, gvinum will
209 expand into this subdisk and grow the whole RAID-5 array.
210 This can be done without unmounting your filesystem.
213 flag is currently ignored.
214 .It Ic stop Oo Fl f Oc Op Ar volume | plex | subdisk
215 Terminate access to the objects, or stop
217 if no parameters are specified.
218 .It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives
219 Create a striped volume from the specified drives.
220 If no name is specified, a unique name will be set by
222 This organization requires at least two drives.
227 utility communicates with the kernel component of the GVinum logical volume
229 It is designed either for interactive use, when started without
230 command line arguments, or to execute a single command if the command is
231 supplied on the command line.
234 maintains a command line history.
238 commands may be followed by an option.
239 .Bl -tag -width indent
244 option overrides safety checks.
245 It should be used with extreme caution.
247 option is required in order to use the
254 option applies the command recursively to subordinate objects.
260 option will also show information about the plexes and subdisks belonging to
262 It is also used by the
264 command to indicate that subordinate objects such as subdisks should be renamed
265 to match the object(s) specified and by the
267 command to delete plexes belonging to a volume and so on.
272 option provides more detailed output.
276 .Pq Dq "very verbose"
277 option provides even more detailed output than
281 .Bl -tag -width ".Ev EDITOR"
283 The name of the editor to use for editing configuration files, by
289 .Bl -tag -width ".Pa /dev/gvinum/plex"
291 directory with device nodes for
296 To create a mirror on disks /dev/ada1 and /dev/ada2, create a filesystem,
297 mount, unmount and then stop
300 .Dl "gvinum mirror /dev/ada1 /dev/ada2"
301 .Dl "newfs /dev/gvinum/gvinumvolume0"
302 .Dl "mount /dev/gvinum/gvinumvolume0 /mnt"
307 To create a striped mirror on disks /dev/ada1 /dev/ada2 /dev/ada3 and
308 /dev/ada4 named "data" and create a filesystem:
310 .Dl "gvinum mirror -s -n data /dev/ada1 /dev/ada2 /dev/ada3 /dev/ada4"
311 .Dl "newfs /dev/gvinum/data"
313 To create a raid5 array on disks /dev/ada1 /dev/ada2 and /dev/ada3,
314 with stripesize 493k you can use the raid5 command:
316 .Dl "gvinum raid5 -s 493k /dev/ada1 /dev/ada2 /dev/ada3"
318 Then the volume will be created automatically.
319 Afterwards, you have to initialize the volume:
321 .Dl "gvinum start myraid5vol"
323 The initialization will start, and the states will be updated when it's
325 The list command will give you information about its progress.
327 Imagine that one of the drives fails, and the output of 'printconfig' looks
330 .Dl "drive gvinumdrive1 device /dev/ada2"
331 .Dl "drive gvinumdrive2 device /dev/???"
332 .Dl "drive gvinumdrive0 device /dev/ada1"
333 .Dl "volume myraid5vol"
334 .Dl "plex name myraid5vol.p0 org raid5 986s vol myraid5vol"
335 .Dl "sd name myraid5vol.p0.s2 drive gvinumdrive2 len 32538s driveoffset 265s"
336 .Dl "plex myraid5vol.p0 plexoffset 1972s"
337 .Dl "sd name myraid5vol.p0.s1 drive gvinumdrive1 len 32538s driveoffset 265s"
338 .Dl "plex myraid5vol.p0 plexoffset 986s"
339 .Dl "sd name myraid5vol.p0.s0 drive gvinumdrive0 len 32538s driveoffset 265s"
340 .Dl "plex myraid5vol.p0 plexoffset 0s"
342 Create a new drive with this configuration:
344 .Dl "drive gdrive4 device /dev/ada4"
346 Then move the stale subdisk to the new drive:
348 .Dl "gvinum move gdrive4 myraid5vol.p0.s2"
350 Then, initiate the rebuild:
352 .Dl "gvinum start myraid5vol.p0"
354 The plex will go up form degraded mode after the rebuild is finished.
355 The plex can still be used while the rebuild is in progress, although requests
358 Given the configuration as in the previous example, growing a RAID-5 or STRIPED
359 array is accomplished by using the grow command:
361 .Dl "gvinum grow myraid5vol.p0 /dev/ada4"
363 If everything went ok, the plex state should now be set to growable.
364 You can then start the growing with the
368 .Dl "gvinum start myraid5vol.p0"
370 As with rebuilding, you can watch the progress using the
374 For a more advanced usage and detailed explanation of gvinum, the
375 handbook is recommended.
382 utility first appeared in
388 is based, was written by
401 documentation were added by
403 through the 2005 Google Summer
405 A partial rewrite of gvinum was done by
409 through the 2007 Google Summer of Code program.
410 The documentation have been updated to reflect the new functionality.
412 .An Lukas Ertl Aq Mt le@FreeBSD.org
413 .An Chris Jones Aq Mt soc-cjones@FreeBSD.org
414 .An Ulf Lilleengen Aq Mt lulf@FreeBSD.org
418 does not rename devices in
428 Moving subdisks that are not part of a mirrored or RAID-5 volume will
430 It is perhaps a bug to permit this.
432 Plexes in which subdisks have been moved do not automatically sync or
434 This may leave data unprotected and is perhaps unwise.
438 does not yet fully implement all of the functions found in
440 Specifically, the following commands from
443 .Bl -tag -width indent
445 Cause the volume manager to enter the kernel debugger.
446 .It Ic debug Ar flags
448 .It Ic dumpconfig Op Ar drive ...
449 List the configuration information stored on the specified drives, or all
450 drives in the system if no drive names are specified.
452 List information about volume manager state.
453 .It Ic label Ar volume
454 Create a volume label.
455 .It Ic resetstats Oo Fl r Oc Op Ar volume | plex | subdisk
456 Reset statistics counters for the specified objects, or for all objects if none
458 .It Ic setdaemon Op Ar value
459 Set daemon configuration.