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