xref: /freebsd/sbin/ggate/ggatel/ggatel.8 (revision 396c556d77189a5c474d35cec6f44a762e310b7d)
1.\" Copyright (c) 2004 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 8, 2016
28.Dt GGATEL 8
29.Os
30.Sh NAME
31.Nm ggatel
32.Nd "GEOM Gate local control utility"
33.Sh SYNOPSIS
34.Nm
35.Cm create
36.Op Fl v
37.Op Fl o Cm ro | wo | rw
38.Op Fl s Ar sectorsize
39.Op Fl t Ar timeout
40.Op Fl u Ar unit
41.Ar path
42.Nm
43.Cm destroy
44.Op Fl f
45.Fl u Ar unit
46.Nm
47.Cm list
48.Op Fl v
49.Op Fl u Ar unit
50.Nm
51.Cm rescue
52.Op Fl v
53.Op Fl o Cm ro | wo | rw
54.Fl u Ar unit
55.Ar path
56.Sh DESCRIPTION
57The
58.Nm
59utility is a local GEOM Gate class consumer.
60It can be used as a replacement for
61.Xr md 4
62devices or as a
63.Dq GEOMificator
64for non GEOM-aware devices, but it was mainly created as an example
65on how to use and how to communicate with the GEOM Gate kernel subsystem.
66.Pp
67Available commands:
68.Bl -tag -width ".Cm destroy"
69.It Cm create
70Create a
71.Nm ggate
72provider related to the given regular file or device.
73.It Cm destroy
74Destroy the given
75.Nm ggate
76provider.
77.It Cm list
78List
79.Nm ggate
80providers.
81.It Cm rescue
82Take over a previously created provider and handle pending and future
83requests.
84This is useful if the initial
85.Nm
86process died.
87To prevent data loss, the given path must lead to the
88regular file or device that was used to create the provider.
89.El
90.Pp
91Available options:
92.Bl -tag -width ".Fl s Cm ro | wo | rw"
93.It Fl f
94Forcibly destroy
95.Nm ggate
96provider (cancels all pending requests).
97.It Fl o Cm ro | wo | rw
98Specify permissions to use when opening the file or device: read-only
99.Pq Cm ro ,
100write-only
101.Pq Cm wo ,
102or read-write
103.Pq Cm rw .
104Default is
105.Cm rw .
106.It Fl s Ar sectorsize
107Sector size for
108.Nm ggate
109provider.
110If not specified, it is taken from the device, or set to 512 bytes for files.
111.It Fl t Ar timeout
112Number of seconds to wait before an I/O request will be canceled.
1130 means no timeout.
114Default is 30.
115.It Fl u Ar unit
116Unit number to use.
117.It Fl v
118Do not fork, run in foreground and print debug information on standard
119output.
120.It Ar path
121Path to a regular file or device.
122.El
123.Sh EXIT STATUS
124Exit status is 0 on success, or 1 if the command fails.
125To get details about the failure,
126.Nm
127should be called with the
128.Fl v
129option.
130.Sh EXAMPLES
131.Dq GEOMify
132the
133.Dq Li fd0
134device and use
135.Xr gbde 8
136to encrypt data on a floppy disk.
137.Bd -literal -offset indent
138ggatel create -u 5 /dev/fd0
139gbde init /dev/ggate5
140gbde attach ggate5
141newfs /dev/ggate5.bde
142mount /dev/ggate5.bde /secret
143cp /private/foo /secret/
144umount /secret
145gbde detach ggate5
146ggatel destroy -u 5
147.Ed
148.Sh SEE ALSO
149.Xr geom 4 ,
150.Xr gbde 8 ,
151.Xr ggatec 8 ,
152.Xr ggated 8 ,
153.Xr mount 8 ,
154.Xr newfs 8
155.Sh HISTORY
156The
157.Nm
158utility appeared in
159.Fx 5.3 .
160.Sh AUTHORS
161The
162.Nm
163utility as well as this manual page was written by
164.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .
165