Document -noswap option
[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" "24 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. If you intend to do that, please use this
91 option to prevent deadlocks. You'll need a special kernel
92 patch, available at NBD's homepage:
93 http://atrey.karlin.mff.cuni.cz/~pavel
94 .TP
95 \fB-nofork\fR
96 Specifies that the NBD client should not detach and
97 daemonize itself. This is mostly useful for debugging.
98 .SH "EXAMPLES"
99 .PP
100 Some examples of nbd-client usage:
101 .TP 0.2i
102 \(bu
103 To connect to a server running on port 2000 at host
104 "server.domain.com", using the client's block special file
105 "/dev/nb0":
106
107 \fBnbd-client server.domain.com 2000
108 /dev/nb0\fR
109 .TP 0.2i
110 \(bu
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:
114
115 \fBnbd-client swapserver.domain.com 2001 /dev/nb1
116 -swap\fR
117 .TP 0.2i
118 \(bu
119 To disconnect the above connection again (after making
120 sure the block special file is not in use anymore):
121
122 \fBnbd-client -d /dev/nb1\fR
123 .SH "SEE ALSO"
124 .PP
125 nbd-server (1).
126 .SH "AUTHOR"
127 .PP
128 The NBD kernel module and the NBD tools have been written by
129 Pavel Macheck (pavel@ucw.cz).
130 .PP
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)
134 .PP
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.