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