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