More build fixes
[nbd.git] / nbd-client.8.sgml
1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2
3 <!-- Process this file with docbook-to-man to generate an nroff manual
4      page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
5      the manual page with: `docbook-to-man manpage.sgml | nroff -man |
6      less'.  A typical entry in a Makefile or Makefile.am is:
7
8 manpage.1: manpage.sgml
9         docbook-to-man $< > $@
10   -->
11
12   <!-- Fill in your name for FIRSTNAME and SURNAME. -->
13   <!ENTITY dhfirstname "<firstname>Wouter</firstname>">
14   <!ENTITY dhsurname   "<surname>Verhelst</surname>">
15   <!-- Please adjust the date whenever revising the manpage. -->
16   <!ENTITY dhdate      "<date>$Date$</date>">
17   <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
18        allowed: see man(7), man(1). -->
19   <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
20   <!ENTITY dhemail     "<email>wouter@debian.org</email>">
21   <!ENTITY dhusername  "Wouter Verhelst">
22   <!ENTITY dhucpackage "<refentrytitle>NBD-CLIENT</refentrytitle>">
23   <!ENTITY dhpackage   "nbd-client">
24
25   <!ENTITY debian      "<productname>Debian GNU/Linux</productname>">
26   <!ENTITY gnu         "<acronym>GNU</acronym>">
27 ]>
28
29 <refentry>
30   <refentryinfo>
31     <address>
32       &dhemail;
33     </address>
34     <author>
35       &dhfirstname;
36       &dhsurname;
37     </author>
38     <copyright>
39       <year>2001</year>
40       <holder>&dhusername;</holder>
41     </copyright>
42     &dhdate;
43   </refentryinfo>
44   <refmeta>
45     &dhucpackage;
46
47     &dhsection;
48   </refmeta>
49   <refnamediv>
50     <refname>&dhpackage;</refname>
51
52     <refpurpose>connect to a server running nbd-server(1), to use its
53     exported block device</refpurpose>
54   </refnamediv>
55   <refsynopsisdiv>
56     <cmdsynopsis>
57       <command>&dhpackage;</command>
58       <arg><option>bs=<replaceable>blocksize</replaceable></option></arg>
59       <arg><option>timeout=<replaceable>seconds</replaceable></option></arg>
60       <arg choice=plain><option><replaceable>host</replaceable></option></arg>
61       <arg choice=plain><option><replaceable>port</replaceable></option></arg>
62       <arg choice=plain><option><replaceable>nbd-device</replaceable></option></arg>
63       <arg><option>-sdp</option></arg>
64       <arg><option>-swap</option></arg>
65       <arg><option>-persist</option></arg>
66     </cmdsynopsis>
67     <cmdsynopsis>
68       <command>&dhpackage;</command>
69       <arg choice=plain><option>-d <replaceable>nbd-device</replaceable></option></arg>
70     </cmdsynopsis>
71     <cmdsynopsis>
72       <command>&dhpackage;</command>
73       <arg choice="plain"><option>-c <replaceable>nbd-device</replaceable></option></arg>
74     </cmdsynopsis>
75   </refsynopsisdiv>
76   <refsect1>
77     <title>DESCRIPTION</title>
78
79     <para>With <command>&dhpackage;</command>, you can connect to a
80     server running <command>nbd-server</command>, thus using raw
81     diskspace from that server as a blockdevice on the local
82     client.</para>
83
84     <para>To do this, support from the Linux Kernel is necessary, in
85     the form of the Network Block Device (NBD). When you have that,
86     either in the kernel, or as a module, you can connect to an NBD
87     server and use its exported file through a block special file with
88     major mode 43.</para>
89     
90   </refsect1>
91   <refsect1>
92     <title>OPTIONS</title>
93
94     <para>The following options are supported:</para>
95
96     <variablelist>
97       <varlistentry>
98         <term><option>bs=<replaceable>blocksize</replaceable></option></term>
99         <listitem>
100           <para>Use a blocksize of "blocksize". Default is 1024;
101             allowed values are either 512, 1024, 2048 or 4096</para>
102         </listitem>
103       </varlistentry>
104       <varlistentry>
105         <term><option>host</option></term>
106         <listitem>
107           <para>The hostname of the machine running
108             <command>nbd-server</command>.</para>
109         </listitem>
110       </varlistentry>
111       <varlistentry>
112         <term><option>timeout=<replaceable>seconds</replaceable></option></term>
113         <listitem>
114           <para>Set the connection timeout to "seconds". For this to
115           work, you need a kernel with support for the NBD_SET_TIMEOUT
116           ioctl; this was introduced into Linus' tree on 2007-10-11,
117           and will be part of kernel 2.6.24.</para>
118         </listitem>
119       </varlistentry>
120       <varlistentry>
121         <term><option>port</option></term>
122         <listitem>
123           <para>The TCP port on which <command>nbd-server</command> is
124             running at the server.</para>
125         </listitem>
126       </varlistentry>
127       <varlistentry>
128         <term><option>nbd-device</option></term>
129         <listitem>
130           <para>The block special file this nbd-client should connect
131             to.</para>
132         </listitem>
133       </varlistentry>
134       <varlistentry>
135         <term>-c</term>
136         <listitem>
137           <para>Check whether the specified nbd device is
138           connected.</para>
139           <para>If the device is connected, &dhpackage; will exit
140           with an exit state of 0 and print the PID of the &dhpackage;
141           instance that connected it to stdout.
142           <para>If the device is not
143           connected or does not exist (for example because the nbd
144           module was not loaded), &dhpackage; will exit with an exit
145           state of 1 and not print anything on stdout.</para>
146           <para>If an error occurred, &dhpackage; will exit with an exit
147           state of 2, and not print anything on stdout either.</para>
148         </listitem>
149       </varlistentry>
150       <varlistentry>
151         <term>-d</term>
152         <listitem>
153           <para>Disconnect the specified nbd device from the
154           server</para>
155         </listitem>
156       </varlistentry>
157       <varlistentry>
158         <term>-persist</term>
159         <listitem>
160           <para>When this option is specified, &dhpackage; will
161             immediately try to reconnect an nbd device if the
162             connection ever drops unexpectedly due to a lost
163             server or something similar.</para>
164         </listitem>
165       </varlistentry>
166       <varlistentry>
167         <term><option>-sdp</option></term>
168         <listitem>
169           <para>Connect to the server using the Socket Direct Protocol
170             (SDP), rather than IP. See nbd-server(1) for details.
171           </para>
172         </listitem>
173       </varlistentry>
174       <varlistentry>
175         <term><option>-swap</option></term>
176         <listitem>
177           <para>Specifies that this NBD device will be used as
178             swapspace. If you intend to do that, please use this
179             option to prevent deadlocks. You'll need a special kernel
180             patch, available at NBD's homepage:
181             http://atrey.karlin.mff.cuni.cz/~pavel</para>
182         </listitem>
183       </varlistentry>
184     </variablelist>
185   </refsect1>
186   <refsect1>
187     <title>EXAMPLES</title>
188
189     <para>Some examples of nbd-client usage:</para>
190     <itemizedlist mark="none">
191       <listitem>
192         <para>To connect to a server running on port 2000 at host
193           "server.domain.com", using the client's block special file
194           "/dev/nb0":</para>
195         <para><command>nbd-client server.domain.com 2000
196           /dev/nb0</command></para>
197       </listitem>
198       <listitem>
199         <para>To connect to a server running on port 2001 at host
200           "swapserver.domain.com", using the client's block special
201           file "/dev/nb1", for swap purposes:</para>
202         <para><command>nbd-client swapserver.domain.com 2001 /dev/nb1
203           -swap</command></para>
204       </listitem>
205       <listitem>
206         <para>To disconnect the above connection again (after making
207           sure the block special file is not in use anymore):</para>
208         <para><command>nbd-client -d /dev/nb1</command></para>
209       </listitem>
210     </itemizedlist>
211   </refsect1>
212   <refsect1>
213     <title>SEE ALSO</title>
214
215     <para>nbd-server (1).</para>
216
217   </refsect1>
218   <refsect1>
219     <title>AUTHOR</title>
220     <para>The NBD kernel module and the NBD tools have been written by
221     Pavel Macheck (pavel@ucw.cz).</para>
222
223     <para>The kernel module is now maintained by Paul Clements
224     (Paul.Clements@steeleye.com), while the userland tools are maintained by
225     Wouter Verhelst (wouter@debian.org)</para>
226
227     <para>This manual page was written by &dhusername; (&dhemail;) for
228     the &debian; system (but may be used by others).  Permission is
229     granted to copy, distribute and/or modify this document under the
230     terms of the <acronym>GNU</acronym> General Public License,
231     version 2, as published by the Free Software Foundation.</para>
232
233   </refsect1>
234 </refentry>
235
236 <!-- Keep this comment at the end of the file
237 Local variables:
238 mode: sgml
239 sgml-omittag:t
240 sgml-shorttag:t
241 sgml-minimize-attributes:nil
242 sgml-always-quote-attributes:t
243 sgml-indent-step:2
244 sgml-indent-data:t
245 sgml-parent-document:nil
246 sgml-default-dtd-file:nil
247 sgml-exposed-tags:nil
248 sgml-local-catalogs:nil
249 sgml-local-ecat-files:nil
250 End:
251 -->