1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
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:
8 manpage.1: manpage.sgml
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">
25 <!ENTITY debian "<productname>Debian GNU/Linux</productname>">
26 <!ENTITY gnu "<acronym>GNU</acronym>">
40 <holder>&dhusername;</holder>
50 <refname>&dhpackage;</refname>
52 <refpurpose>serve a file as a block device to other computers
53 running the &gnu;/Linux(tm) or &gnu;/Hurd Operating
58 <command>&dhpackage; </command>
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>-a <replaceable>timeout</replaceable></option></arg>
67 <arg><option>-l <replaceable>host list filename</replaceable></option></arg>
68 <arg><option>-o <replaceable>section name</replaceable></option></arg>
69 <arg><option>-C <replaceable>config file</replaceable></option></arg>
73 <title>DESCRIPTION</title>
75 <para><command>&dhpackage;</command> is the server for the Linux
76 Network Block Device (NBD). With NBD, a client can use a file,
77 exported over the network from a server, as a block device. It can
78 then be used for whatever purpose a normal block device (harddisk,
79 CD-ROM, ...) can be used for.</para>
81 <para>NBD can be useful for diskless clients that need swapspace,
82 but you can also create a filesystem on it and use it as though it
83 were a local filesystem.</para>
85 <para><command>&dhpackage;</command> implements some security
86 through a file called "nbd_server.allow" in the current directory (by default; a different file can be chosen with the '-l' option).
87 This file must list the IP-addresses of clients that are allowed
88 to connect. If it does not exist, all clients are able to connect.
89 If the file is empty, no clients can connect.</para>
92 <title>OPTIONS</title>
98 <para>The ip address the server should listen on. If
99 omitted, 0.0.0.0 (aka "any address") is used.</para>
103 <term><option>port</option>
106 <para>The port the server should listen to. A valid port is
107 any number between 1 and 65536; if 0 is used, nbd-server
108 will listen on stdin (so that nbd-server can be ran from
113 <term><option>filename</option></term>
115 <para>The filename of the file that should be exported. This
116 can be any file, including "real" blockdevices (i.e. a file
117 from /dev). If the filename includes the literal string
118 "%s", then this %s will be substituded with the IP-address
119 of the client trying to connect.</para>
123 <term><option>size</option></term>
125 <para>The size of the block device at the client side. This
126 is especially usefull in conjunction with the -m
128 <para>Can optionally be followed by one of K,k,M or
129 m, in which case the size will be multiplied by 1024 (K
130 or k) or 1048576 (M or m)</para>
134 <term><option>-r</option></term>
136 <para>Export the file read-only. If a client tries to write
137 to a read-only exported file, it will receive an error, but
138 the connection will stay up.</para>
142 <term><option>-m</option></term>
144 <para>Work with multiple files. This can be used to export
145 blockdevices that are larger than the maximum allowed
146 filesize on a given filesystem; i.e. when the filesystem
147 does not allow files larger than 2GB (which is true for
148 Linux 2.2 and below), you can use this option to store the
149 data in multiple files and export a larger filesystem, if
152 To use this option, you must create a number of files
153 with names in the format "name.X", where "name" is given as
154 the filename argument to nbd-server, and "X" is a number
155 starting by 0 and going up for each file.
158 Allowing more flexibility for this option is planned for
159 future versions.</para>
163 <term><option>-c</option></term>
165 <para>Copy on write. When this option is provided,
166 write-operations are not done to the exported file, but to a
167 separate file. This separate file is removed when the
168 connection is closed, which means that serving this way will
169 make nbd-server slow down (especially on large block devices
170 with lots of writes), and that after disconnecting and
171 reconnecting the client or the server, all changes are
176 <term><option>-C</option></term>
178 <para>Specify configuration file. The default configuration
179 file, if this parameter is not specified, is
180 <filename>@sysconfdir@/nbd-server/config</filename>.</para>
181 <para>Note that the configuration file is always parsed and
182 the entries in the file used, even if an extra server is
183 specified on the command line. To disable the configuration
184 file entirely, either move it away or use the -C option to
185 point <command>nbd-server</command>(1) to a non-existing or
186 empty configuration file.</para>
190 <term><option>timeout</option></term>
192 <para>Maximum number of idle seconds. If a connection is
193 inactive for this amount of time, it is terminated; this is to
194 avoid stale nbd-server processes staying in memory. Use of
195 this option is strongly recommended.</para>
199 <term><option>host list filename</option></term>
201 <para>This argument should contain a list of IP-addresses
202 for hosts that may connect to the server. Wildcards are
203 <emphasis>not</emphasis> allowed. If the file does not
204 exist, it is ignored (and any host can connect); If the file
205 does exist, but is empty, no host can connect. By default,
206 the name 'nbd_server.allow' is used, and looked for in the
207 current directory, unless nbd-server is compiled as a
208 daemon, in which case it is looked for in the
209 root-directory.</para>
213 <term><option>section name</option></term>
215 <para>If the <option>-o</option> argument is given on the
216 command line, then &dhpackage; will output a configuration
217 file section with this as the header that is functionally
218 equivalent to the other options specified on the command line,
219 and exit. This is useful for migrating pre-2.9 nbd-server
220 initscript configuration files to the new format.</para>
227 <title>EXAMPLES</title>
228 <para>Some examples of nbd-server usage:</para>
229 <itemizedlist mark="none">
231 <para>To export a file /export/nbd/exp-bl-dev on port 2000:</para>
232 <para><command>nbd-server 2000 /export/nbd/exp-bl-dev</command></para>
235 <para>To export a the same file read-only:</para>
236 <para><command>nbd-server 2000 /export/nbd/exp-bl-dev -r</command></para>
239 <para>To export the same file read-write, but make sure
240 changes are lost after restarting the client or the
242 <para><command>nbd-server 2000 /export/nbd/exp-bl-dev
248 <title>SEE ALSO</title>
250 <para>nbd-client (8), nbd-server (5), http://nbd.sourceforge.net/roadmap.html</para>
254 <title>AUTHOR</title>
255 <para>The NBD kernel module and the NBD tools were originally
256 written by Pavel Machek (pavel@ucw.cz)</para>
258 <para>The Linux kernel module is now maintained by Paul Clements
259 (Paul.Clements@steeleye.com), while the userland tools are
260 maintained by &dhusername; (&dhemail;)</para>
262 <para>On The Hurd there is a regular translator available to perform the
263 client side of the protocol, and the use of
264 <command>nbd-client</command> is not required. Please see the
265 relevant documentation for more information.</para>
267 <para>This manual page was written by &dhusername; (&dhemail;) for
268 the &debian; system (but may be used by others). Permission is
269 granted to copy, distribute and/or modify this document under
270 the terms of the <acronym>GNU</acronym> General Public License,
271 version 2, as published by the Free Software Foundation.</para>
276 <!-- Keep this comment at the end of the file
281 sgml-minimize-attributes:nil
282 sgml-always-quote-attributes:t
285 sgml-parent-document:nil
286 sgml-default-dtd-file:nil
287 sgml-exposed-tags:nil
288 sgml-local-catalogs:nil
289 sgml-local-ecat-files:nil