xref: /freebsd/sbin/geom/core/geom.8 (revision 7899f917b1c0ea178f1d2be0cfb452086d079d23)
1.\"-
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.Dd May 9, 2023
29.Dt GEOM 8
30.Os
31.Sh NAME
32.Nm geom
33.Nd universal control utility for GEOM classes
34.Sh SYNOPSIS
35.Nm
36.Ar class
37.Cm help
38.Nm
39.Ar class
40.Cm list
41.Op Fl a
42.Op Ar name ...
43.Nm
44.Ar class
45.Cm status
46.Op Fl ags
47.Op Ar name ...
48.Nm
49.Ar class
50.Cm load
51.Op Fl v
52.Nm
53.Ar class
54.Cm unload
55.Op Fl v
56.Nm
57.Fl p
58.Ar provider-name
59.Nm
60.Fl t
61.Sh DESCRIPTION
62The
63.Nm
64utility is used to control various GEOM classes.
65A class has to be aware of
66.Nm
67communication methods, but there are also some standard commands
68which can be used for existing
69.Nm
70unaware classes.
71Here is the list of standard commands:
72.Bl -tag -width indent
73.It Cm help
74List all available commands for the given class.
75.It Cm list
76Print detailed information (within the given class) about all geoms
77(if no additional arguments were specified) or the given geoms.
78This command is only available if the given class exists in the kernel.
79Additional options include:
80.Bl -tag -width "-a"
81.It Fl a
82Print information for geoms without providers.
83.El
84.It Cm status
85Print general information (within the given class) about all geoms
86(if no additional arguments were specified) or the given geoms.
87This command is only available if the given class exists in the kernel.
88.Pp
89Additional options include:
90.Bl -tag -width "-s"
91.It Fl a
92When used with
93.Fl g ,
94print status for geoms without providers.
95.It Fl g
96Report statuses for geoms instead of providers.
97.It Fl s
98Produce script-friendly output.
99.El
100.It Cm load
101Load the kernel module that implements the given class.
102This command is only available if the class does not yet exist in the kernel and
103the file
104.Pa geom_ Ns Ao Ar class Ac Ns Pa .ko
105can be found in one of the directories specified in
106.Va kern.module_path
107sysctl.
108.It Cm unload
109Unload the kernel module which implements the given class.
110This command is only available if the given class is loaded as a
111kernel module.
112.El
113.Pp
114Additional options include:
115.Bl -tag -width indent
116.It Fl p Ar provider-name
117Print detailed information about the geom which provides
118.Ar provider-name .
119.It Fl t
120Display geoms hierarchy as a tree.
121.El
122.Pp
123Class-specific commands are implemented as shared libraries which
124are stored in
125.Pa /lib/geom/
126directory and are loaded via
127.Xr dlopen 3
128function when the class name is known.
129When a class-specific shared library exists, a direct utility should also be
130available under the name of
131.Nm g Ns Ar class .
132.Pp
133Currently, classes aware of
134.Nm
135are:
136.Pp
137.Bl -bullet -offset indent -compact
138.It
139CACHE
140.It
141CONCAT
142.It
143ELI
144.It
145JOURNAL
146.It
147LABEL
148.It
149MIRROR
150.It
151MOUNTVER
152.It
153MULTIPATH
154.It
155NOP
156.It
157PART
158.It
159RAID
160.It
161RAID3
162.It
163SCHED
164.It
165SHSEC
166.It
167STRIPE
168.It
169UNION
170.It
171VINUM (deprecated)
172.It
173VIRSTOR
174.El
175.Sh ENVIRONMENT
176The following environment variables affect the execution of
177.Nm :
178.Bl -tag -width "GEOM_LIBRARY_PATH"
179.It Ev GEOM_LIBRARY_PATH
180Specifies the path where shared libraries are stored instead of
181.Pa /lib/geom/ .
182Multiple paths can be specified with a colon-separated list of paths.
183.El
184.Sh EXIT STATUS
185Exit status is 0 on success, and 1 if the command fails.
186.Sh EXAMPLES
187The following example shows how to set up a stripe on three disks for automatic
188configuration:
189.Bd -literal -offset indent
190geom stripe label -v -s 65536 data /dev/da0 /dev/da1 /dev/da2
191.Ed
192.Pp
193or:
194.Bd -literal -offset indent
195gstripe label -v -s 65536 data /dev/da0 /dev/da1 /dev/da2
196.Ed
197.Pp
198Print the list of all providers from the DISK class:
199.Bd -literal -offset indent
200geom disk list
201.Ed
202.Pp
203Unload a kernel module which implements the MD class:
204.Bd -literal -offset indent
205geom md unload
206.Ed
207.Sh SEE ALSO
208.Xr libgeom 3 ,
209.Xr geom 4 ,
210.Xr gcache 8 ,
211.Xr gconcat 8 ,
212.Xr geli 8 ,
213.Xr gjournal 8 ,
214.Xr glabel 8 ,
215.Xr gmirror 8 ,
216.Xr gmountver 8 ,
217.Xr gmultipath 8 ,
218.Xr gnop 8 ,
219.Xr gpart 8 ,
220.Xr graid3 8 ,
221.Xr gshsec 8 ,
222.Xr gstripe 8 ,
223.Xr gunion 8 ,
224.Xr gvinum 8 ,
225.Xr gvirstor 8
226.Sh HISTORY
227The
228.Nm
229utility appeared in
230.Fx 5.3 .
231.Sh AUTHORS
232.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
233