1 .\" This manpage has been automatically generated by docbook2man
2 .\" from a DocBook document. This tool can be found at:
3 .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
4 .\" Please send any bug reports, improvements, comments, patches,
5 .\" etc. to Steve Cheng <steve@ggi-project.org>.
6 .TH "NBD-CLIENT" "8" "14 June 2010" "" ""
9 nbd-client \- connect to a server running nbd-server(1), to use its exported block device
12 \fBnbd-client\fR [ \fBbs=\fIblocksize\fB\fR ] [ \fBtimeout=\fIseconds\fB\fR ] \fB\fIhost\fB\fR \fB\fIport\fB\fR \fB\fInbd-device\fB\fR [ \fB-sdp\fR ] [ \fB-swap\fR ] [ \fB-persist\fR ] [ \fB-nofork\fR ]
15 \fBnbd-client\fR \fB-d \fInbd-device\fB\fR
18 \fBnbd-client\fR \fB-c \fInbd-device\fB\fR
22 With \fBnbd-client\fR, you can connect to a
23 server running \fBnbd-server\fR, thus using raw
24 diskspace from that server as a blockdevice on the local
27 To do this, support from the Linux Kernel is necessary, in
28 the form of the Network Block Device (NBD). When you have that,
29 either in the kernel, or as a module, you can connect to an NBD
30 server and use its exported file through a block special file with
34 The following options are supported:
36 \fBbs=\fIblocksize\fB\fR
37 Use a blocksize of "blocksize". Default is 1024;
38 allowed values are either 512, 1024, 2048 or 4096
41 The hostname or IP address of the machine running
42 \fBnbd-server\fR\&. Since 2.9.15, the NBD
43 utilities support IPv6.
45 \fBtimeout=\fIseconds\fB\fR
46 Set the connection timeout to "seconds". For this to
47 work, you need a kernel with support for the NBD_SET_TIMEOUT
48 ioctl; this was introduced into Linus' tree on 2007-10-11,
49 and will be part of kernel 2.6.24.
52 The TCP port on which \fBnbd-server\fR is
53 running at the server.
56 The block special file this nbd-client should connect
60 Check whether the specified nbd device is
63 If the device is connected, nbd-client will exit
64 with an exit state of 0 and print the PID of the nbd-client
65 instance that connected it to stdout.
68 connected or does not exist (for example because the nbd
69 module was not loaded), nbd-client will exit with an exit
70 state of 1 and not print anything on stdout.
72 If an error occurred, nbd-client will exit with an exit
73 state of 2, and not print anything on stdout either.
76 Disconnect the specified nbd device from the
80 When this option is specified, nbd-client will
81 immediately try to reconnect an nbd device if the
82 connection ever drops unexpectedly due to a lost
83 server or something similar.
86 Connect to the server using the Socket Direct Protocol
87 (SDP), rather than IP. See nbd-server(1) for details.
90 Specifies that this NBD device will be used as
91 swapspace. This option attempts to prevent deadlocks by
92 performing mlockall() at an appropriate time. It does not
93 however guarantee that such deadlocks can be avoided.
96 Specifies that the NBD client should not detach and
97 daemonize itself. This is mostly useful for debugging.
100 Some examples of nbd-client usage:
103 To connect to a server running on port 2000 at host
104 "server.domain.com", using the client's block special file
107 \fBnbd-client server.domain.com 2000
111 To connect to a server running on port 2001 at host
112 "swapserver.domain.com", using the client's block special
113 file "/dev/nb1", for swap purposes:
115 \fBnbd-client swapserver.domain.com 2001 /dev/nb1
119 To disconnect the above connection again (after making
120 sure the block special file is not in use anymore):
122 \fBnbd-client -d /dev/nb1\fR
128 The NBD kernel module and the NBD tools have been written by
129 Pavel Macheck (pavel@ucw.cz).
131 The kernel module is now maintained by Paul Clements
132 (Paul.Clements@steeleye.com), while the userland tools are maintained by
133 Wouter Verhelst (wouter@debian.org)
135 This manual page was written by Wouter Verhelst (<wouter@debian.org>) for
136 the Debian GNU/Linux system (but may be used by others). Permission is
137 granted to copy, distribute and/or modify this document under the
138 terms of the GNU General Public License,
139 version 2, as published by the Free Software Foundation.