xref: /freebsd/sbin/geom/core/geom.8 (revision ec965063070e5753c166cf592c9336444b74720a)
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 December 12, 2022
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 available classes which are aware of
131.Nm :
132.Pp
133.Bl -bullet -offset indent -compact
134.It
135CACHE
136.It
137CONCAT
138.It
139ELI
140.It
141JOURNAL
142.It
143LABEL
144.It
145MIRROR
146.It
147MOUNTVER
148.It
149MULTIPATH
150.It
151NOP
152.It
153PART
154.It
155RAID
156.It
157RAID3
158.It
159SCHED
160.It
161SHSEC
162.It
163STRIPE
164.It
165UNION
166.It
167VINUM (deprecated)
168.It
169VIRSTOR
170.El
171.Sh ENVIRONMENT
172The following environment variables affect the execution of
173.Nm :
174.Bl -tag -width ".Ev GEOM_LIBRARY_PATH"
175.It Ev GEOM_LIBRARY_PATH
176Specifies the path where shared libraries are stored instead of
177.Pa /lib/geom/ .
178Multiple paths can be specified with a colon-separated list of paths.
179.El
180.Sh EXIT STATUS
181Exit status is 0 on success, and 1 if the command fails.
182.Sh EXAMPLES
183The following example shows how to set up a stripe on three disks for automatic
184configuration:
185.Bd -literal -offset indent
186geom stripe label -v -s 65536 data /dev/da0 /dev/da1 /dev/da2
187or:
188gstripe label -v -s 65536 data /dev/da0 /dev/da1 /dev/da2
189.Ed
190.Pp
191Print the list of all providers from the DISK class:
192.Bd -literal -offset indent
193geom disk list
194.Ed
195.Pp
196Unload a kernel module which implements the MD class:
197.Bd -literal -offset indent
198geom md unload
199.Ed
200.Sh SEE ALSO
201.Xr libgeom 3 ,
202.Xr geom 4 ,
203.Xr gcache 8 ,
204.Xr gconcat 8 ,
205.Xr geli 8 ,
206.Xr gjournal 8 ,
207.Xr glabel 8 ,
208.Xr gmirror 8 ,
209.Xr gmountver 8 ,
210.Xr gmultipath 8 ,
211.Xr gnop 8 ,
212.Xr gpart 8 ,
213.Xr graid3 8 ,
214.Xr gsched 8 ,
215.Xr gshsec 8 ,
216.Xr gstripe 8 ,
217.Xr gunion 8 ,
218.Xr gvinum 8 ,
219.Xr gvirstor 8
220.Sh HISTORY
221The
222.Nm
223utility appeared in
224.Fx 5.3 .
225.Sh AUTHORS
226.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
227