xref: /freebsd/sbin/geom/core/geom.8 (revision 6829dae12bb055451fa467da4589c43bd03b1e64)
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 September 14, 2018
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.Xr geom 8
66communication methods, but there are also some standard commands
67which can be used for existing
68.Xr geom 8
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.Xr geom 8 :
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
165VIRSTOR
166.El
167.Sh ENVIRONMENT
168The following environment variables affect the execution of
169.Nm :
170.Bl -tag -width ".Ev GEOM_LIBRARY_PATH"
171.It Ev GEOM_LIBRARY_PATH
172Specifies the path where shared libraries are stored instead of
173.Pa /lib/geom/ .
174Multiple paths can be specified with a colon-separated list of paths.
175.El
176.Sh EXIT STATUS
177Exit status is 0 on success, and 1 if the command fails.
178.Sh EXAMPLES
179The following example shows how to set up a stripe on three disks for automatic
180configuration:
181.Bd -literal -offset indent
182geom stripe label -v -s 65536 data /dev/da0 /dev/da1 /dev/da2
183or:
184gstripe label -v -s 65536 data /dev/da0 /dev/da1 /dev/da2
185.Ed
186.Pp
187Print the list of all providers from the DISK class:
188.Bd -literal -offset indent
189geom disk list
190.Ed
191.Pp
192Unload a kernel module which implements the MD class:
193.Bd -literal -offset indent
194geom md unload
195.Ed
196.Sh SEE ALSO
197.Xr libgeom 3 ,
198.Xr geom 4 ,
199.Xr gcache 8 ,
200.Xr gconcat 8 ,
201.Xr geli 8 ,
202.Xr gjournal 8 ,
203.Xr glabel 8 ,
204.Xr gmirror 8 ,
205.Xr gmountver 8 ,
206.Xr gmultipath 8 ,
207.Xr gnop 8 ,
208.Xr gpart 8 ,
209.Xr graid3 8 ,
210.Xr gsched 8 ,
211.Xr gshsec 8 ,
212.Xr gstripe 8 ,
213.Xr gvirstor 8
214.Sh HISTORY
215The
216.Nm
217utility appeared in
218.Fx 5.3 .
219.Sh AUTHORS
220.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
221