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