1 .\" Copyright (c) 2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
2 .\" Copyright (c) 2005 Ivan Voras <ivoras@FreeBSD.org>
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .Nd "provides virtual data storage geom"
72 utility is used for setting up a storage device of arbitrary large size (for example,
73 several TB), consisting of an arbitrary number of physical storage devices with
74 total size <= the virtual size. Data for the virtual devices will be allocated from
75 physical devices on demand. In short, this is the virtual storage functionality.
78 indicates an action to be performed:
79 .Bl -tag -width ".Cm destroy"
81 Set up a virtual device from the given components with the specified
83 Metadata are stored in the last sector of every component.
86 is the size of new virtual device, with default being 2 TiB (2097152 MiB).
89 is the chunk size, with default being 4 MiB (4096 KiB).
90 The default is thus "-s 2097152 -m 4096".
92 Turn off an existing virtual device by its
94 This command does not touch on-disk metadata.
95 As with other GEOM classes, stopped geoms cannot be started manually.
97 Adds new components to existing virtual device by its
99 The specified virstor device must exist and be active (i.e.
100 module loaded, device present in /dev).
102 Removes components from existing virtual device by its
104 Only unallocated providers can be removed.
106 Clear metadata on the given providers.
108 Dump metadata stored on the given providers.
124 .Bl -tag -width ".Fl f"
126 Force the removal of the specified virtual device.
128 Hardcode providers' names in metadata.
133 Exit status is 0 on success, and 1 if the command fails.
135 The following example shows how to create a virtual device of default size
136 (2 TiB), of default chunk (extent) size (4 MiB), with two physical devices for
138 .Bd -literal -offset indent
139 gvirstor label -v mydata /dev/ad4 /dev/ad6
140 newfs /dev/virstor/mydata
143 From now on, the virtual device will be available via the
144 .Pa /dev/virstor/mydata
146 To add a new physical device / provider to an active virstor device:
147 .Bd -literal -offset indent
148 gvirstor add mydata ad8
151 This will add physical storage (from ad8) to
152 .Pa /dev/virstor/mydata
154 To see device status information (including how much physical storage
155 is still available for the virtual device), use:
156 .Bd -literal -offset indent
162 subcommands (e.g. "status", "help") are also supported.
168 .Bd -literal -offset indent
169 .Pa int kern.geom.virstor.debug
172 This sysctl controls verbosity of the kernel module, in the range
173 1 to 15. Messages that are marked with higher verbosity levels than
174 this are supressed. Default value is 5 and it's not
175 recommented to set this tunable to less than 2, because level 1 messages
176 are error events, and level 2 messages are system warnings.
177 .Bd -literal -offset indent
178 .Pa int kern.geom.virstor.chunk_watermark
181 Value in this sysctl sets warning watermark level for physical chunk usage
182 on a single component. The warning is issued when a virstor component
183 has less than this many free chunks (default 100).
184 .Bd -literal -offset indent
185 .Pa int kern.geom.virstor.component_watermark
188 Value in this sysctl sets warning watermark level for component usage.
189 The warning is issed when there are less than this many unallocated
190 components (default is 1).
192 All these sysctls are also available as
197 kernel module issues log messages with prefixes in standardised format,
198 which is useful for log message filtering and dispatching. Each message
200 .Bd -literal -offset indent
201 .Pa GEOM_VIRSTOR[%d]:
204 The number (%d) is message verbosity / importance level, in the range
205 1 to 15. If a message filtering, dispatching or operator alert system is
206 used, it is recommended that messages with levels 1 and 2 be taken
207 seriously (for example, to catch out-of-space conditions as set by
221 Commands "add" and "remove" contain unavoidable critical sections
222 which may make the virstor device unusable if a power failure (or
223 other disruptive event) happens during their execution.
224 It's recommended to run them when the system is quiescent.
226 .An Ivan Voras Aq ivoras@FreeBSD.org
227 Sponsored by Google Summer of Code 2006