Revisit documentation
[nbd.git] / nbd-client.8.sgml
index 67e09a8..af19bbc 100644 (file)
@@ -1,4 +1,4 @@
-<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN" [
 
 <!-- Process this file with docbook-to-man to generate an nroff manual
      page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
@@ -13,7 +13,7 @@ manpage.1: manpage.sgml
   <!ENTITY dhfirstname "<firstname>Wouter</firstname>">
   <!ENTITY dhsurname   "<surname>Verhelst</surname>">
   <!-- Please adjust the date whenever revising the manpage. -->
-  <!ENTITY dhdate      "<date>september 19, 2001</date>">
+  <!ENTITY dhdate      "<date>$Date$</date>">
   <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
        allowed: see man(7), man(1). -->
   <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
@@ -55,26 +55,29 @@ manpage.1: manpage.sgml
   <refsynopsisdiv>
     <cmdsynopsis>
       <command>&dhpackage;</command>
-      <arg><option>bs=<replaceable>blocksize</replaceable></option></arg>
-      <arg choice=plain><option><replaceable>host</replaceable></option></arg>
-      <arg choice=plain><option><replaceable>port</replaceable></option></arg>
-      <arg choice=plain><option><replaceable>nbd-device</replaceable></option></arg>
-      <arg><option>-swap</option></arg>
+      <arg choice=plain><replaceable>host</replaceable></arg>
+      <arg><replaceable>port</replaceable></arg>
+      <arg choice=plain><replaceable>nbd-device</replaceable></arg>
+      <arg>-sdp</arg>
+      <arg>-swap</arg>
+      <arg>-persist</arg>
+      <arg>-nofork</arg>
+      <arg>-block-size <replaceable>block size</replaceable></arg>
+      <arg>-timeout <replaceable>seconds</replaceable></arg>
+      <arg>-name <replaceable>name</replaceable></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>&dhpackage;</command>
       <arg choice=plain><option>-d <replaceable>nbd-device</replaceable></option></arg>
     </cmdsynopsis>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+      <arg choice="plain"><option>-c <replaceable>nbd-device</replaceable></option></arg>
+    </cmdsynopsis>
   </refsynopsisdiv>
   <refsect1>
     <title>DESCRIPTION</title>
 
-    <para>This manual page documents briefly the
-      <command>&dhpackage;</command> command.</para>
-
-    <para>This manual page was written for the &debian; distribution
-      because the original program does not have a manual page.</para>
-
     <para>With <command>&dhpackage;</command>, you can connect to a
     server running <command>nbd-server</command>, thus using raw
     diskspace from that server as a blockdevice on the local
@@ -86,6 +89,8 @@ manpage.1: manpage.sgml
     server and use its exported file through a block special file with
     major mode 43.</para>
 
+    <para>Optionally, long options can also be specified with two
+      leading dashes.</para>
   </refsect1>
   <refsect1>
     <title>OPTIONS</title>
@@ -94,17 +99,30 @@ manpage.1: manpage.sgml
 
     <variablelist>
       <varlistentry>
-       <term><option>bs=<replaceable>blocksize</replaceable></option></term>
+       <term><option>-block-size <replaceable>block size</replaceable></option></term>
+       <term><option>-b</option></term>
        <listitem>
-         <para>Use a blocksize of "blocksize". Default is 1024;
+         <para>Use a blocksize of "block size". Default is 1024;
            allowed values are either 512, 1024, 2048 or 4096</para>
        </listitem>
       </varlistentry>
       <varlistentry>
        <term><option>host</option></term>
        <listitem>
-         <para>The hostname of the machine running
-           <command>nbd-server</command>.</para>
+         <para>The hostname or IP address of the machine running
+           <command>nbd-server</command>. Since 2.9.15, the NBD
+           utilities support IPv6.</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term><option>-timeout
+       <replaceable>seconds</replaceable></option></term>
+       <term><option>-t</option></term>
+       <listitem>
+         <para>Set the connection timeout to "seconds". For this to
+         work, you need a kernel with support for the NBD_SET_TIMEOUT
+         ioctl; this was introduced into Linus' tree on 2007-10-11,
+         and will be part of kernel 2.6.24.</para>
        </listitem>
       </varlistentry>
       <varlistentry>
@@ -112,6 +130,8 @@ manpage.1: manpage.sgml
        <listitem>
          <para>The TCP port on which <command>nbd-server</command> is
            running at the server.</para>
+         <para>This option is required, unless the -N option is
+           specified, in which case it is not allowed.</para>
        </listitem>
       </varlistentry>
       <varlistentry>
@@ -122,13 +142,80 @@ manpage.1: manpage.sgml
        </listitem>
       </varlistentry>
       <varlistentry>
+       <term><option>-check</option></term>
+       <term><option>-c</option></term>
+       <listitem>
+         <para>Check whether the specified nbd device is
+         connected.</para>
+         <para>If the device is connected, &dhpackage; will exit
+         with an exit state of 0 and print the PID of the &dhpackage;
+         instance that connected it to stdout.
+         <para>If the device is not
+         connected or does not exist (for example because the nbd
+         module was not loaded), &dhpackage; will exit with an exit
+         state of 1 and not print anything on stdout.</para>
+         <para>If an error occurred, &dhpackage; will exit with an exit
+         state of 2, and not print anything on stdout either.</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term><option>-disconnect</option></term>
+       <term><option>-d</option></term>
+       <listitem>
+         <para>Disconnect the specified nbd device from the
+         server</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+       <term><option>-persist</option></term>
+       <term><option>-p</option></term>
+       <listitem>
+         <para>When this option is specified, &dhpackage; will
+           immediately try to reconnect an nbd device if the
+           connection ever drops unexpectedly due to a lost
+           server or something similar.</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-sdp</option></term>
+       <term><option>-S</option></term>
+       <listitem>
+         <para>Connect to the server using the Socket Direct Protocol
+           (SDP), rather than IP. See nbd-server(1) for details.
+         </para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
        <term><option>-swap</option></term>
+       <term><option>-s</option></term>
        <listitem>
          <para>Specifies that this NBD device will be used as
-           swapspace. If you intend to do that, please use this
-           option to prevent deadlocks. You'll need a special kernel
-           patch, available at NBD's homepage:
-           http://atrey.karlin.mff.cuni.cz/~pavel</para>
+         swapspace. This option attempts to prevent deadlocks by
+         performing mlockall() at an appropriate time. It does not
+         however guarantee that such deadlocks can be avoided.</para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-nofork</option></term>
+       <term><option>-n</option></term>
+       <listitem>
+         <para>Specifies that the NBD client should not detach and
+         daemonize itself. This is mostly useful for debugging.</para>
+         <para>
+           Note that nbd-client will still fork once to trigger an
+           update to the device node's partition table. It is not
+           possible to disable this.
+         </para>
+       </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-name</option></term>
+       <term><option>-N</option></term>
+       <listitem>
+         <para>
+           Specifies the name of the export that we want to use. Required if
+           the port is not specified, not allowed in the other case.
+         </para>
        </listitem>
       </varlistentry>
     </variablelist>
@@ -141,21 +228,21 @@ manpage.1: manpage.sgml
       <listitem>
        <para>To connect to a server running on port 2000 at host
          "server.domain.com", using the client's block special file
-         "/dev/nd0":</para>
-       <para><command>nbd-client 2000 server.domain.com
-         /dev/nd0</command></para>
+         "/dev/nbd0":</para>
+       <para><command>nbd-client server.domain.com 2000
+         /dev/nbd0</command></para>
       </listitem>
       <listitem>
        <para>To connect to a server running on port 2001 at host
          "swapserver.domain.com", using the client's block special
-         file "/dev/nd1", for swap purposes:</para>
-       <para><command>nbd-client 2001 swapserver.domain.com /dev/nd1
+         file "/dev/nbd1", for swap purposes:</para>
+       <para><command>nbd-client swapserver.domain.com 2001 /dev/nbd1
          -swap</command></para>
       </listitem>
       <listitem>
        <para>To disconnect the above connection again (after making
          sure the block special file is not in use anymore):</para>
-       <para><command>nbd-client -d /dev/nd1</command></para>
+       <para><command>nbd-client -d /dev/nbd1</command></para>
       </listitem>
     </itemizedlist>
   </refsect1>
@@ -170,30 +257,15 @@ manpage.1: manpage.sgml
     <para>The NBD kernel module and the NBD tools have been written by
     Pavel Macheck (pavel@ucw.cz).</para>
 
+    <para>The kernel module is now maintained by Paul Clements
+    (Paul.Clements@steeleye.com), while the userland tools are maintained by
+    Wouter Verhelst (wouter@debian.org)</para>
+
     <para>This manual page was written by &dhusername; (&dhemail;) for
     the &debian; system (but may be used by others).  Permission is
     granted to copy, distribute and/or modify this document under the
-    terms of the <acronym>GNU</acronym> Free Documentation License,
-    Version 1.1 or any later version published by the Free Software
-    Foundation; with no Invariant Sections, no Front-Cover Texts and
-    no Back-Cover Texts.</para>
+    terms of the <acronym>GNU</acronym> General Public License,
+    version 2, as published by the Free Software Foundation.</para>
 
   </refsect1>
 </refentry>
-
-<!-- Keep this comment at the end of the file
-Local variables:
-mode: sgml
-sgml-omittag:t
-sgml-shorttag:t
-sgml-minimize-attributes:nil
-sgml-always-quote-attributes:t
-sgml-indent-step:2
-sgml-indent-data:t
-sgml-parent-document:nil
-sgml-default-dtd-file:nil
-sgml-exposed-tags:nil
-sgml-local-catalogs:nil
-sgml-local-ecat-files:nil
-End:
--->