1 .\" Copyright (c) 2006-2008 Ivan Voras <ivoras@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd "control utility for virtual data storage devices"
71 utility is used for setting up a virtual storage device of arbitrary
73 .Pq for example, several TB ,
74 consisting of an arbitrary number of physical storage devices with the
75 total size which is equal to or smaller than the virtual size.
76 Data for the virtual devices will be allocated from physical devices on
80 is similar to the concept of Virtual Memory in operating systems,
81 effectively allowing users to overcommit on storage
82 .Pq free file system space .
85 indicates an action to be performed:
86 .Bl -tag -width ".Cm remove"
88 Set up a virtual device from the given components with the specified
90 Metadata is stored in the last sector of every component.
93 is the size of new virtual device, with default being set to 2 TiB
97 is the chunk size, with default being set to 4 MiB
99 The default arguments are thus
100 .Qq Fl s Ar 2097152 Fl m Ar 4096 .
102 Turn off an existing virtual device with the given
104 This command does not touch on-disk metadata.
105 As with other GEOM classes, stopped geoms cannot be started manually.
107 Adds new components to existing virtual device with the given
109 The specified virstor device must exist and be active
110 .Pq i.e. module loaded, device present in Pa /dev .
111 This action can be safely performed while the virstor device is in use
112 .Pq Qo hot Qc operation
114 Removes components from existing virtual device with the given
116 Only unallocated providers can be removed.
118 Clear metadata on the given providers.
120 Dump metadata stored on the given providers.
136 .Bl -tag -width ".Fl f"
138 Force the removal of the specified virtual device.
140 Hardcode providers' names in metadata.
145 The following example shows how to create a virtual device of default size
151 with two physical devices for backing storage.
152 .Bd -literal -offset indent
153 .No gvirstor label -v Ar mydata Ar /dev/ad4 Ar /dev/ad6
154 .No newfs Ar /dev/virstor/mydata
157 From now on, the virtual device will be available via the
158 .Pa /dev/virstor/mydata
160 To add a new physical device / component to an active virstor device:
161 .Bd -literal -offset indent
162 .No gvirstor add Ar mydata Ar ad8
165 This will add physical storage of
168 .Pa /dev/virstor/mydata
171 To see the device status information
172 .Pq including how much physical storage is still available for the virtual device ,
174 .Bd -literal -offset indent
181 .Pq e.g. Cm status , Cm help
188 .Bd -literal -offset indent
189 .Va int kern.geom.virstor.debug
192 This sysctl controls verbosity of the kernel module, in the range
194 Messages that are marked with higher verbosity levels than this are
196 Default value is 5 and it is not recommended to set this tunable to less
197 than 2, because level 1 messages are error events, and level 2 messages
199 .Bd -literal -offset indent
200 .Va int kern.geom.virstor.chunk_watermark
203 Value in this sysctl sets warning watermark level for physical chunk
204 usage on a single component.
205 The warning is issued when a virstor component has less than this many
208 .Bd -literal -offset indent
209 .Va int kern.geom.virstor.component_watermark
212 Value in this sysctl sets warning watermark level for component usage.
213 The warning is issued when there are less than this many unallocated
217 All these sysctls are also available as
224 kernel module issues log messages with prefixes in standardized format,
225 which is useful for log message filtering and dispatching.
226 Each message line begins with
227 .Bd -literal -offset indent
228 .Li GEOM_VIRSTOR[%d]:
233 is message verbosity / importance level, in the range 1 to 15.
234 If a message filtering, dispatching or operator alert system is used, it
235 is recommended that messages with levels 1 and 2 be taken seriously
236 .Pq for example, to catch out-of-space conditions as set by watermark
247 utility first appeared in
254 contain unavoidable critical sections which may make the virstor
255 device unusable if a power failure
256 .Pq or other disruptive event
257 happens during their execution.
258 It is recommended to run them when the system is quiescent.
259 .Sh ASSUMPTIONS AND INTERACTION WITH FILE SYSTEMS
260 There are several assumptions that
262 has in its operation: that the size of the virtual storage device will not
263 change once it is set, and that the sizes of individual physical storage
264 components will always remain constant during their existence.
265 For alternative ways to implement virtual or resizable file systems see
272 has nontrivial interaction with file systems which initialize a large
273 number of on-disk structures during newfs.
274 If such file systems attempt to spread their structures across the drive
276 .Pq like UFS/UFS2 does ,
277 their efforts will be effectively foiled by sequential allocation of
280 and all their structures will be physically allocated at the start
281 of the first virstor component.
282 This could have a significant impact on file system performance
283 .Pq which can in some rare cases be even positive .
285 .An Ivan Voras Aq ivoras@FreeBSD.org
287 Sponsored by Google Summer of Code 2006.