Patches from Debian
[nbd.git] / nbd-client.8.in
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" "26 May 2009" "" ""
7
8 .SH NAME
9 nbd-client \- connect to a server running nbd-server(1), to use its    exported block device
10 .SH SYNOPSIS
11
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 ]
13
14
15 \fBnbd-client\fR \fB-d \fInbd-device\fB\fR
16
17
18 \fBnbd-client\fR \fB-c \fInbd-device\fB\fR
19
20 .SH "DESCRIPTION"
21 .PP
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
25 client.
26 .PP
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
31 major mode 43.
32 .SH "OPTIONS"
33 .PP
34 The following options are supported:
35 .TP
36 \fBbs=\fIblocksize\fB\fR
37 Use a blocksize of "blocksize". Default is 1024;
38 allowed values are either 512, 1024, 2048 or 4096
39 .TP
40 \fBhost\fR
41 The hostname of the machine running
42 \fBnbd-server\fR\&.
43 .TP
44 \fBtimeout=\fIseconds\fB\fR
45 Set the connection timeout to "seconds". For this to
46 work, you need a kernel with support for the NBD_SET_TIMEOUT
47 ioctl; this was introduced into Linus' tree on 2007-10-11,
48 and will be part of kernel 2.6.24.
49 .TP
50 \fBport\fR
51 The TCP port on which \fBnbd-server\fR is
52 running at the server.
53 .TP
54 \fBnbd-device\fR
55 The block special file this nbd-client should connect
56 to.
57 .TP
58 \fB-c\fR
59 Check whether the specified nbd device is
60 connected.
61
62 If the device is connected, nbd-client will exit
63 with an exit state of 0 and print the PID of the nbd-client
64 instance that connected it to stdout.
65
66 If the device is not
67 connected or does not exist (for example because the nbd
68 module was not loaded), nbd-client will exit with an exit
69 state of 1 and not print anything on stdout.
70
71 If an error occurred, nbd-client will exit with an exit
72 state of 2, and not print anything on stdout either.
73 .TP
74 \fB-d\fR
75 Disconnect the specified nbd device from the
76 server
77 .TP
78 \fB-persist\fR
79 When this option is specified, nbd-client will
80 immediately try to reconnect an nbd device if the
81 connection ever drops unexpectedly due to a lost
82 server or something similar.
83 .TP
84 \fB-sdp\fR
85 Connect to the server using the Socket Direct Protocol
86 (SDP), rather than IP. See nbd-server(1) for details.
87 .TP
88 \fB-swap\fR
89 Specifies that this NBD device will be used as
90 swapspace. This option attempts to prevent deadlocks by
91 performing mlockall() at an appropriate time. It does not
92 however guarantee that such deadlocks can be avoided.
93 .TP
94 \fB-nofork\fR
95 Specifies that the NBD client should not detach and
96 daemonize itself. This is mostly useful for debugging.
97 .SH "EXAMPLES"
98 .PP
99 Some examples of nbd-client usage:
100 .TP 0.2i
101 \(bu
102 To connect to a server running on port 2000 at host
103 "server.domain.com", using the client's block special file
104 "/dev/nb0":
105
106 \fBnbd-client server.domain.com 2000
107 /dev/nb0\fR
108 .TP 0.2i
109 \(bu
110 To connect to a server running on port 2001 at host
111 "swapserver.domain.com", using the client's block special
112 file "/dev/nb1", for swap purposes:
113
114 \fBnbd-client swapserver.domain.com 2001 /dev/nb1
115 -swap\fR
116 .TP 0.2i
117 \(bu
118 To disconnect the above connection again (after making
119 sure the block special file is not in use anymore):
120
121 \fBnbd-client -d /dev/nb1\fR
122 .SH "SEE ALSO"
123 .PP
124 nbd-server (1).
125 .SH "AUTHOR"
126 .PP
127 The NBD kernel module and the NBD tools have been written by
128 Pavel Macheck (pavel@ucw.cz).
129 .PP
130 The kernel module is now maintained by Paul Clements
131 (Paul.Clements@steeleye.com), while the userland tools are maintained by
132 Wouter Verhelst (wouter@debian.org)
133 .PP
134 This manual page was written by Wouter Verhelst (<wouter@debian.org>) for
135 the Debian GNU/Linux system (but may be used by others).  Permission is
136 granted to copy, distribute and/or modify this document under the
137 terms of the GNU General Public License,
138 version 2, as published by the Free Software Foundation.