Documentation update
[nbd.git] / nbd-server.1.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>1</manvolnum>">
20   <!ENTITY dhemail     "<email>wouter@debian.org</email>">
21   <!ENTITY dhusername  "Wouter Verhelst">
22   <!ENTITY dhucpackage "<refentrytitle>NBD-SERVER</refentrytitle>">
23   <!ENTITY dhpackage   "nbd-server">
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>serve a file as a block device to other computers
53     running the &gnu;/Linux(tm) or &gnu;/Hurd Operating
54     System</refpurpose>
55   </refnamediv>
56   <refsynopsisdiv>
57     <cmdsynopsis>
58       <command>&dhpackage; </command>
59
60       <arg choice=plain><replaceable>[ip@]port</replaceable</arg>
61       <arg choice=plain><replaceable>filename</replaceable></arg>
62       <arg><replaceable>size</replaceable></arg>
63       <arg><option>-r</option></arg>
64       <arg><option>-m</option></arg>
65       <arg><option>-c</option></arg>
66       <arg><option>-l <replaceable>host list filename</replaceable></option></arg>
67       <arg><option>-o <replaceable>section name</replaceable></option></arg>
68       <arg><option>-C <replaceable>config file</replaceable></option></arg>
69     </cmdsynopsis>
70   </refsynopsisdiv>
71   <refsect1>
72     <title>DESCRIPTION</title>
73
74     <para><command>&dhpackage;</command> is the server for the Linux
75     Network Block Device (NBD). With NBD, a client can use a file,
76     exported over the network from a server, as a block device. It can
77     then be used for whatever purpose a normal block device (harddisk,
78     CD-ROM, ...) can be used for.</para>
79
80     <para>NBD can be useful for diskless clients that need swapspace,
81     but you can also create a filesystem on it and use it as though it
82     were a local filesystem.</para>
83
84     <para><command>&dhpackage;</command> implements some security
85     through a file called "nbd_server.allow" in the current directory (by default; a different file can be chosen with the '-l' option).
86     This file must list the IP-addresses of clients that are allowed
87     to connect. If it does not exist, all clients are able to connect.
88     If the file is empty, no clients can connect.</para>
89   </refsect1>
90   <refsect1>
91     <title>OPTIONS</title>
92     
93     <variablelist>
94       <varlistentry>
95         <term>ip</term>
96         <listitem>
97           <para>The ip address the server should listen on. This may
98           be an IPv4 address, an IPv6 address, or a hostname. In the
99           latter case, nbd-server will do a hostname lookup for the
100           name specified, and will listen on the first address that is
101           returned. For compatibility with past versions of
102           nbd-server, if an IPv4 address is specified, the @ sign that
103           serves as separator between the address and port may be
104           replaced by a colon.</para>
105           <para>If this parameter is not specified, nbd-server will
106           listen on all local addresses on both IPv4 and IPv6. To
107           limit to IPv4, specify the address as 0.0.0.0; to limit to
108           IPv6, specify it as ::.</para>
109         </listitem>
110       </varlistentry>
111       <varlistentry>
112         <term><option>port</option>
113         </term>
114         <listitem>
115           <para>The port the server should listen to. A valid port is
116             any number between 1 and 65536; if 0 is used, nbd-server
117             will listen on stdin (so that nbd-server can be ran from
118             inetd)</para>
119         </listitem>
120       </varlistentry>
121       <varlistentry>
122         <term><option>filename</option></term>
123         <listitem>
124           <para>The filename of the file that should be exported. This
125           can be any file, including "real" blockdevices (i.e. a file
126           from /dev). If the filename includes the literal string
127           "%s", then this %s will be substituded with the IP-address
128           of the client trying to connect.</para>
129         </listitem>
130       </varlistentry>
131       <varlistentry>
132         <term><option>size</option></term>
133         <listitem>
134           <para>The size of the block device at the client side. This
135             is especially usefull in conjunction with the -m
136             option</para>
137           <para>Can optionally be followed by one of K,k,M or
138             m, in which case the size will be multiplied by 1024 (K
139             or k) or 1048576 (M or m)</para>
140         </listitem>
141       </varlistentry>
142       <varlistentry>
143         <term><option>-r</option></term>
144         <listitem>
145           <para>Export the file read-only. If a client tries to write
146             to a read-only exported file, it will receive an error, but
147             the connection will stay up.</para>
148         </listitem>
149       </varlistentry>
150       <varlistentry>
151         <term><option>-m</option></term>
152         <listitem>
153           <para>Work with multiple files. This can be used to export
154             blockdevices that are larger than the maximum allowed
155             filesize on a given filesystem; i.e. when the filesystem
156             does not allow files larger than 2GB (which is true for
157             Linux 2.2 and below), you can use this option to store the
158             data in multiple files and export a larger filesystem, if
159             needed.</para>
160           <para>
161             To use this option, you must create a number of files
162             with names in the format "name.X", where "name" is given as
163             the filename argument to nbd-server, and "X" is a number
164             starting by 0 and going up for each file.
165           </para>
166           <para>
167             Allowing more flexibility for this option is planned for
168             future versions.</para>
169         </listitem>
170       </varlistentry>
171       <varlistentry>
172         <term><option>-c</option></term>
173         <listitem>
174           <para>Copy on write. When this option is provided,
175             write-operations are not done to the exported file, but to a
176             separate file. This separate file is removed when the
177             connection is closed, which means that serving this way will
178             make nbd-server slow down (especially on large block devices
179             with lots of writes), and that after disconnecting and
180             reconnecting the client or the server, all changes are
181             lost.</para>
182         </listitem>
183       </varlistentry>
184       <varlistentry>
185         <term><option>-C</option></term>
186         <listitem>
187           <para>Specify configuration file. The default configuration
188             file, if this parameter is not specified, is
189             <filename>@sysconfdir@/nbd-server/config</filename>.</para>
190           <para>Note that the configuration file is always parsed and
191             the entries in the file used, even if an extra server is
192             specified on the command line. To disable the configuration
193             file entirely, either move it away or use the -C option to
194             point <command>nbd-server</command>(1) to a non-existing or
195             empty configuration file.</para>
196           <para>Also note that if an empty, incomplete, or invalid
197             configuration file is specified, nbd-server will produce a
198             warning about failure to parse the config file. If the
199             command line contains a fully specified configuration, this
200             warning is harmless and may be ignored.</para>
201         </listitem>
202       </varlistentry>
203       <varlistentry>
204         <term><option>host list filename</option></term>
205         <listitem>
206           <para>This argument should contain a list of IP-addresses
207             for hosts that may connect to the server. Wildcards are
208             <emphasis>not</emphasis> allowed. If the file does not
209             exist, it is ignored (and any host can connect); If the file
210             does exist, but is empty, no host can connect. By default,
211             the name 'nbd_server.allow' is used, and looked for in the
212             current directory, unless nbd-server is compiled as a
213             daemon, in which case it is looked for in the
214             root-directory.</para>
215         </listitem>
216       </varlistentry>
217       <varlistentry>
218         <term><option>section name</option></term>
219         <listitem>
220           <para>If the <option>-o</option> argument is given on the
221           command line, then &dhpackage; will output a configuration
222           file section with this as the header that is functionally
223           equivalent to the other options specified on the command line,
224           and exit. This is useful for migrating pre-2.9 nbd-server
225           initscript configuration files to the new format.</para>
226         </listitem>
227       </varlistentry>
228     </variablelist>
229     
230   </refsect1>
231   <refsect1>
232     <title>EXAMPLES</title>
233     <para>Some examples of nbd-server usage:</para>
234     <itemizedlist mark="none">
235       <listitem>
236         <para>To export a file /export/nbd/exp-bl-dev on port 2000:</para>
237         <para><command>nbd-server 2000 /export/nbd/exp-bl-dev</command></para>
238       </listitem>
239       <listitem>
240         <para>To export a the same file read-only:</para>
241         <para><command>nbd-server 2000 /export/nbd/exp-bl-dev -r</command></para>
242       </listitem>
243       <listitem>
244         <para>To export the same file read-write, but make sure
245           changes are lost after restarting the client or the
246           server:</para>
247         <para><command>nbd-server 2000 /export/nbd/exp-bl-dev
248             -c</command></para>
249       </listitem>
250     </itemizedlist>
251   </refsect1>
252   <refsect1>
253     <title>SEE ALSO</title>
254     
255     <para>nbd-client (8), nbd-server (5), http://nbd.sourceforge.net/roadmap.html</para>
256     
257   </refsect1>
258   <refsect1>
259     <title>AUTHOR</title>
260     <para>The NBD kernel module and the NBD tools were originally
261       written by Pavel Machek (pavel@ucw.cz)</para>
262     
263     <para>The Linux kernel module is now maintained by Paul Clements
264       (Paul.Clements@steeleye.com), while the userland tools are
265       maintained by &dhusername; (&dhemail;)</para>
266
267     <para>On The Hurd there is a regular translator available to perform the
268       client side of the protocol, and the use of
269       <command>nbd-client</command> is not required. Please see the
270       relevant documentation for more information.</para>
271
272     <para>This manual page was written by &dhusername; (&dhemail;) for
273       the &debian; system (but may be used by others).  Permission is
274       granted to copy, distribute and/or modify this document under
275       the terms of the <acronym>GNU</acronym> General Public License,
276       version 2, as published by the Free Software Foundation.</para>
277
278   </refsect1>
279 </refentry>
280
281 <!-- Keep this comment at the end of the file
282 Local variables:
283 mode: sgml
284 sgml-omittag:t
285 sgml-shorttag:t
286 sgml-minimize-attributes:nil
287 sgml-always-quote-attributes:t
288 sgml-indent-step:2
289 sgml-indent-data:t
290 sgml-parent-document:nil
291 sgml-default-dtd-file:nil
292 sgml-exposed-tags:nil
293 sgml-local-catalogs:nil
294 sgml-local-ecat-files:nil
295 End:
296 -->