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