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