1DRBDSETUP(8) System Administration DRBDSETUP(8)
2
3
4
6 drbdsetup - Setup tool for DRBD .
7
9 drbdsetup {device} disk {lower_dev} {meta_data_dev} {meta_data_index}
10 [-d {size}] [-e {err_handler}] [-f {fencing_policy}] [-b]
11
12 drbdsetup {device} net [af:] {local_addr} [:port] [af:] {remote_addr}
13 [:port] {protocol} [-c {time}] [-i {time}] [-t {val}]
14 [-S {size}] [-r {size}] [-k {count}] [-e {max_epoch_size}]
15 [-b {max_buffers}] [-m] [-a {hash_alg}] [-x {shared_secret}]
16 [-A {asb-0p-policy}] [-B {asb-1p-policy}]
17 [-C {asb-2p-policy}] [-D] [-R {role-resync-conflict-policy}]
18 [-p {ping_timeout}] [-u {val}] [-d {hash_alg}] [-o] [-n]
19
20 drbdsetup {device} syncer [-a {dev_minor}] [-r {rate}] [-e {extents}]
21 [-v {verify-hash-alg}] [-c {cpu-mask}] [-C {csums-hash-alg}]
22 [-R] [-V {delay-probe-volume}] [-I {delay-probe-interval}]
23 [-T {throttle-delay}] [-H {hold-off-delay}]
24
25 drbdsetup {device} disconnect
26
27 drbdsetup {device} detach
28
29 drbdsetup {device} down
30
31 drbdsetup {device} primary [-f] [-o]
32
33 drbdsetup {device} secondary
34
35 drbdsetup {device} verify [-s {start-position}]
36
37 drbdsetup {device} invalidate
38
39 drbdsetup {device} invalidate-remote
40
41 drbdsetup {device} wait-connect [-t {wfc_timeout}]
42 [-d {degr_wfc_timeout}] [-o {outdated_wfc_timeout}] [-w]
43
44 drbdsetup {device} wait-sync [-t {wfc_timeout}] [-d {degr_wfc_timeout}]
45 [-o {outdated_wfc_timeout}] [-w]
46
47 drbdsetup {device} role
48
49 drbdsetup {device} cstate
50
51 drbdsetup {device} dstate
52
53 drbdsetup {device} status
54
55 drbdsetup {device} resize [-d {size}] [-f {assume-peer-has-space}]
56 [-c {assume-clean}]
57
58 drbdsetup {device} check-resize
59
60 drbdsetup {device} pause-sync
61
62 drbdsetup {device} resume-sync
63
64 drbdsetup {device} outdate
65
66 drbdsetup {device} show-gi
67
68 drbdsetup {device} get-gi
69
70 drbdsetup {device} show
71
72 drbdsetup {device} suspend-io
73
74 drbdsetup {device} resume-io
75
76 drbdsetup {device} events [-u] [-a]
77
78 drbdsetup {device} new-current-uuid [-c]
79
81 drbdsetup is used to associate DRBD devices with their backing block
82 devices, to set up DRBD device pairs to mirror their backing block
83 devices, and to inspect the configuration of running DRBD devices.
84
86 drbdsetup is a low level tool of the DRBD program suite. It is used by
87 the data disk and drbd scripts to communicate with the device driver.
88
90 Each drbdsetup sub-command might require arguments and bring its own
91 set of options. All values have default units which might be overruled
92 by K, M or G. These units are defined in the usual way (e.g. K = 2^10 =
93 1024).
94
95 Common options
96 All drbdsetup sub-commands accept these two options
97
98 --create-device
99 In case the specified DRBD device (minor number) does not exist
100 yet, create it implicitly.
101
102 --set-defaults
103 When --set-defaults is given on the command line, all options of
104 the invoked sub-command that are not explicitly set are reset to
105 their default values.
106
107 disk
108 Associates device with lower_device to store its data blocks on. The -d
109 (or --disk-size) should only be used if you wish not to use as much as
110 possible from the backing block devices. If you do not use -d, the
111 device is only ready for use as soon as it was connected to its peer
112 once. (See the net command.)
113
114 -d, --disk-size size
115 You can override DRBD's size determination method with this option.
116 If you need to use the device before it was ever connected to its
117 peer, use this option to pass the size of the DRBD device to the
118 driver. Default unit is sectors (1s = 512 bytes).
119
120 If you use the size parameter in drbd.conf, we strongly recommend
121 to add an explicit unit postfix. drbdadm and drbdsetup used to have
122 mismatching default units.
123
124 -e, --on-io-error err_handler
125 If the driver of the lower_device reports an error to DRBD, DRBD
126 will either pass the error to the upper layers of the operating
127 system, call a helper program, or detach the device from its
128 backing storage and perform all further IO by requesting it from
129 the peer. The valid err_handlers are: pass_on, call-local-io-error
130 and detach.
131
132 -f, --fencing fencing_policy
133 Under fencing we understand preventive measures to avoid situations
134 where both nodes are primary and disconnected (AKA split brain).
135
136 Valid fencing policies are:
137
138 dont-care
139 This is the default policy. No fencing actions are done.
140
141 resource-only
142 If a node becomes a disconnected primary, it tries to outdate
143 the peer's disk. This is done by calling the fence-peer
144 handler. The handler is supposed to reach the other node over
145 alternative communication paths and call 'drbdadm outdate res'
146 there.
147
148 resource-and-stonith
149 If a node becomes a disconnected primary, it freezes all its IO
150 operations and calls its fence-peer handler. The fence-peer
151 handler is supposed to reach the peer over alternative
152 communication paths and call 'drbdadm outdate res' there. In
153 case it cannot reach the peer, it should stonith the peer. IO
154 is resumed as soon as the situation is resolved. In case your
155 handler fails, you can resume IO with the resume-io command.
156
157 -b, --use-bmbv
158 In case the backing storage's driver has a merge_bvec_fn()
159 function, DRBD has to pretend that it can only process IO requests
160 in units not larger than 4 KiB. (At time of writing the only known
161 drivers which have such a function are: md (software raid driver),
162 dm (device mapper - LVM) and DRBD itself)
163
164 To get best performance out of DRBD on top of software raid (or any
165 other driver with a merge_bvec_fn() function) you might enable this
166 option, if you know for sure that the merge_bvec_fn() function will
167 deliver the same results on all nodes of your cluster. I.e. the
168 physical disks of the software raid are exactly of the same type.
169 USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.
170
171 -a, --no-disk-barrier, -i, --no-disk-flushes, -D, --no-disk-drain
172 DRBD has four implementations to express write-after-write
173 dependencies to its backing storage device. DRBD will use the first
174 method that is supported by the backing storage device and that is
175 not disabled by the user.
176
177 When selecting the method you should not only base your decision on
178 the measurable performance. In case your backing storage device has
179 a volatile write cache (plain disks, RAID of plain disks) you
180 should use one of the first two. In case your backing storage
181 device has battery-backed write cache you may go with option 3 or
182 4. Option 4 will deliver the best performance such devices.
183
184 Unfortunately device mapper (LVM) might not support barriers.
185
186 The letter after "wo:" in /proc/drbd indicates with method is
187 currently in use for a device: b, f, d, n. The implementations:
188
189 barrier
190 The first requires that the driver of the backing storage
191 device support barriers (called 'tagged command queuing' in
192 SCSI and 'native command queuing' in SATA speak). The use of
193 this method can be disabled by the --no-disk-barrier option.
194
195 flush
196 The second requires that the backing device support disk
197 flushes (called 'force unit access' in the drive vendors
198 speak). The use of this method can be disabled using the
199 --no-disk-flushes option.
200
201 drain
202 The third method is simply to let write requests drain before
203 write requests of a new reordering domain are issued. That was
204 the only implementation before 8.0.9. You can prevent to use of
205 this method by using the --no-disk-drain option.
206
207 none
208 The fourth method is to not express write-after-write
209 dependencies to the backing store at all.
210
211 -m, --no-md-flushes
212 Disables the use of disk flushes and barrier BIOs when accessing
213 the meta data device. See the notes on --no-disk-flushes.
214
215 -s, --max-bio-bvecs
216 In some special circumstances the device mapper stack manages to
217 pass BIOs to DRBD that violate the constraints that are set forth
218 by DRBD's merge_bvec() function and which have more than one bvec.
219 A known example is: phys-disk -> DRBD -> LVM -> Xen -> missaligned
220 partition (63) -> DomU FS. Then you might see "bio would need to,
221 but cannot, be split:" in the Dom0's kernel log.
222
223 The best workaround is to proper align the partition within the VM
224 (E.g. start it at sector 1024). That costs 480 KiB of storage.
225 Unfortunately the default of most Linux partitioning tools is to
226 start the first partition at an odd number (63). Therefore most
227 distributions install helpers for virtual linux machines will end
228 up with missaligned partitions. The second best workaround is to
229 limit DRBD's max bvecs per BIO (i.e., the max-bio-bvecs option) to
230 1, but that might cost performance.
231
232 The default value of max-bio-bvecs is 0, which means that there is
233 no user imposed limitation.
234
235 net
236 Sets up the device to listen on af:local_addr:port for incoming
237 connections and to try to connect to af:remote_addr:port. If port is
238 omitted, 7788 is used as default. If af is omitted ipv4 gets used.
239 Other supported address families are ipv6, ssocks for Dolphin
240 Interconnect Solutions' "super sockets" and sdp for Sockets Direct
241 Protocol (Infiniband).
242
243 On the TCP/IP link the specified protocol is used. Valid protocol
244 specifiers are A, B, and C.
245
246 Protocol A: write IO is reported as completed, if it has reached local
247 disk and local TCP send buffer.
248
249 Protocol B: write IO is reported as completed, if it has reached local
250 disk and remote buffer cache.
251
252 Protocol C: write IO is reported as completed, if it has reached both
253 local and remote disk.
254
255 -c, --connect-int time
256 In case it is not possible to connect to the remote DRBD device
257 immediately, DRBD keeps on trying to connect. With this option you
258 can set the time between two retries. The default value is 10
259 seconds, the unit is 1 second.
260
261 -i, --ping-int time
262 If the TCP/IP connection linking a DRBD device pair is idle for
263 more than time seconds, DRBD will generate a keep-alive packet to
264 check if its partner is still alive. The default value is 10
265 seconds, the unit is 1 second.
266
267 -t, --timeout val
268 If the partner node fails to send an expected response packet
269 within val tenths of a second, the partner node is considered dead
270 and therefore the TCP/IP connection is abandoned. The default value
271 is 60 (= 6 seconds).
272
273 -S, --sndbuf-size size
274 The socket send buffer is used to store packets sent to the
275 secondary node, which are not yet acknowledged (from a network
276 point of view) by the secondary node. When using protocol A, it
277 might be necessary to increase the size of this data structure in
278 order to increase asynchronicity between primary and secondary
279 nodes. But keep in mind that more asynchronicity is synonymous with
280 more data loss in the case of a primary node failure. Since 8.0.13
281 resp. 8.2.7 setting the size value to 0 means that the kernel
282 should autotune this. The default size is 0, i.e. autotune.
283
284 -r, --rcvbuf-size size
285 Packets received from the network are stored in the socket receive
286 buffer first. From there they are consumed by DRBD. Before 8.3.2
287 the receive buffer's size was always set to the size of the socket
288 send buffer. Since 8.3.2 they can be tuned independently. A value
289 of 0 means that the kernel should autotune this. The default size
290 is 0, i.e. autotune.
291
292 -k, --ko-count count
293 In case the secondary node fails to complete a single write request
294 for count times the timeout, it is expelled from the cluster, i.e.
295 the primary node goes into StandAlone mode. The default is 0, which
296 disables this feature.
297
298 -e, --max-epoch-size val
299 With this option the maximal number of write requests between two
300 barriers is limited. Should be set to the same as --max-buffers.
301 Values smaller than 10 can lead to degraded performance. The
302 default value is 2048.
303
304 -b, --max-buffers val
305 With this option the maximal number of buffer pages allocated by
306 DRBD's receiver thread is limited. Should be set to the same as
307 --max-epoch-size. Small values could lead to degraded performance.
308 The default value is 2048, the minimum 32.
309
310 -u, --unplug-watermark val
311 When the number of pending write requests on the standby
312 (secondary) node exceeds the unplug-watermark, we trigger the
313 request processing of our backing storage device. Some storage
314 controllers deliver better performance with small values, others
315 deliver best performance when the value is set to the same value as
316 max-buffers. Minimum 16, default 128, maximum 131072.
317
318 -m, --allow-two-primaries
319 With this option set you may assign primary role to both nodes. You
320 only should use this option if you use a shared storage file system
321 on top of DRBD. At the time of writing the only ones are: OCFS2 and
322 GFS. If you use this option with any other file system, you are
323 going to crash your nodes and to corrupt your data!
324
325 -a, --cram-hmac-alg alg
326 You need to specify the HMAC algorithm to enable peer
327 authentication at all. You are strongly encouraged to use peer
328 authentication. The HMAC algorithm will be used for the challenge
329 response authentication of the peer. You may specify any digest
330 algorithm that is named in /proc/crypto.
331
332 -x, --shared-secret secret
333 The shared secret used in peer authentication. May be up to 64
334 characters.
335
336 -A, --after-sb-0pri asb-0p-policy
337 possible policies are:
338
339 disconnect
340 No automatic resynchronization, simply disconnect.
341
342 discard-younger-primary
343 Auto sync from the node that was primary before the split-brain
344 situation occurred.
345
346 discard-older-primary
347 Auto sync from the node that became primary as second during
348 the split-brain situation.
349
350 discard-zero-changes
351 In case one node did not write anything since the split brain
352 became evident, sync from the node that wrote something to the
353 node that did not write anything. In case none wrote anything
354 this policy uses a random decision to perform a "resync" of 0
355 blocks. In case both have written something this policy
356 disconnects the nodes.
357
358 discard-least-changes
359 Auto sync from the node that touched more blocks during the
360 split brain situation.
361
362 discard-node-NODENAME
363 Auto sync to the named node.
364
365 -B, --after-sb-1pri asb-1p-policy
366 possible policies are:
367
368 disconnect
369 No automatic resynchronization, simply disconnect.
370
371 consensus
372 Discard the version of the secondary if the outcome of the
373 after-sb-0pri algorithm would also destroy the current
374 secondary's data. Otherwise disconnect.
375
376 discard-secondary
377 Discard the secondary's version.
378
379 call-pri-lost-after-sb
380 Always honor the outcome of the after-sb-0pri algorithm. In
381 case it decides the current secondary has the correct data,
382 call the pri-lost-after-sb on the current primary.
383
384 violently-as0p
385 Always honor the outcome of the after-sb-0pri algorithm. In
386 case it decides the current secondary has the correct data,
387 accept a possible instantaneous change of the primary's data.
388
389 -C, --after-sb-2pri asb-2p-policy
390 possible policies are:
391
392 disconnect
393 No automatic resynchronization, simply disconnect.
394
395 call-pri-lost-after-sb
396 Always honor the outcome of the after-sb-0pri algorithm. In
397 case it decides the current secondary has the right data, call
398 the pri-lost-after-sb on the current primary.
399
400 violently-as0p
401 Always honor the outcome of the after-sb-0pri algorithm. In
402 case it decides the current secondary has the right data,
403 accept a possible instantaneous change of the primary's data.
404
405 -P, --always-asbp
406 Normally the automatic after-split-brain policies are only used if
407 current states of the UUIDs do not indicate the presence of a third
408 node.
409
410 With this option you request that the automatic after-split-brain
411 policies are used as long as the data sets of the nodes are somehow
412 related. This might cause a full sync, if the UUIDs indicate the
413 presence of a third node. (Or double faults have led to strange
414 UUID sets.)
415
416 -R, --rr-conflict role-resync-conflict-policy
417 This option sets DRBD's behavior when DRBD deduces from its meta
418 data that a resynchronization is needed, and the SyncTarget node is
419 already primary. The possible settings are: disconnect,
420 call-pri-lost and violently. While disconnect speaks for itself,
421 with the call-pri-lost setting the pri-lost handler is called which
422 is expected to either change the role of the node to secondary, or
423 remove the node from the cluster. The default is disconnect.
424
425 With the violently setting you allow DRBD to force a primary node
426 into SyncTarget state. This means that the data exposed by DRBD
427 changes to the SyncSource's version of the data instantaneously.
428 USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.
429
430 -d, --data-integrity-alg hash_alg
431 DRBD can ensure the data integrity of the user's data on the
432 network by comparing hash values. Normally this is ensured by the
433 16 bit checksums in the headers of TCP/IP packets. This option can
434 be set to any of the kernel's data digest algorithms. In a typical
435 kernel configuration you should have at least one of md5, sha1, and
436 crc32c available. By default this is not enabled.
437
438 See also the notes on data integrity on the drbd.conf manpage.
439
440 -o, --no-tcp-cork
441 DRBD usually uses the TCP socket option TCP_CORK to hint to the
442 network stack when it can expect more data, and when it should
443 flush out what it has in its send queue. There is at least one
444 network stack that performs worse when one uses this hinting
445 method. Therefore we introduced this option, which disable the
446 setting and clearing of the TCP_CORK socket option by DRBD.
447
448 -p, --ping-timeout ping_timeout
449 The time the peer has to answer to a keep-alive packet. In case the
450 peer's reply is not received within this time period, it is
451 considered dead. The default unit is tenths of a second, the
452 default value is 5 (for half a second).
453
454 -D, --discard-my-data
455 Use this option to manually recover from a split-brain situation.
456 In case you do not have any automatic after-split-brain policies
457 selected, the nodes refuse to connect. By passing this option you
458 make this node a sync target immediately after successful connect.
459
460 -n, --dry-run
461 Causes DRBD to abort the connection process after the resync
462 handshake, i.e. no resync gets performed. You can find out which
463 resync DRBD would perform by looking at the kernel's log file.
464
465 syncer
466 Changes the synchronization daemon parameters of device at runtime.
467
468 -r, --rate rate
469 To ensure smooth operation of the application on top of DRBD, it is
470 possible to limit the bandwidth that may be used by background
471 synchronization. The default is 250 KiB/sec, the default unit is
472 KiB/sec.
473
474 -a, --after minor
475 Start resync on this device only if the device with minor is
476 already in connected state. Otherwise this device waits in
477 SyncPause state.
478
479 -e, --al-extents extents
480 DRBD automatically performs hot area detection. With this parameter
481 you control how big the hot area (=active set) can get. Each extent
482 marks 4M of the backing storage. In case a primary node leaves the
483 cluster unexpectedly, the areas covered by the active set must be
484 resynced upon rejoining of the failed node. The data structure is
485 stored in the meta-data area, therefore each change of the active
486 set is a write operation to the meta-data device. A higher number
487 of extents gives longer resync times but less updates to the
488 meta-data. The default number of extents is 127. (Minimum: 7,
489 Maximum: 3843)
490
491 -v, --verify-alg hash-alg
492 During online verification (as initiated by the verify
493 sub-command), rather than doing a bit-wise comparison, DRBD applies
494 a hash function to the contents of every block being verified, and
495 compares that hash with the peer. This option defines the hash
496 algorithm being used for that purpose. It can be set to any of the
497 kernel's data digest algorithms. In a typical kernel configuration
498 you should have at least one of md5, sha1, and crc32c available. By
499 default this is not enabled; you must set this option explicitly in
500 order to be able to use on-line device verification.
501
502 See also the notes on data integrity on the drbd.conf manpage.
503
504 -c, --cpu-mask cpu-mask
505 Sets the cpu-affinity-mask for DRBD's kernel threads of this
506 device. The default value of cpu-mask is 0, which means that DRBD's
507 kernel threads should be spread over all CPUs of the machine. This
508 value must be given in hexadecimal notation. If it is too big it
509 will be truncated.
510
511 -C, --csums-alg hash-alg
512 A resync process sends all marked data blocks form the source to
513 the destination node, as long as no csums-alg is given. When one is
514 specified the resync process exchanges hash values of all marked
515 blocks first, and sends only those data blocks over, that have
516 different hash values.
517
518 This setting is useful for DRBD setups with low bandwidth links.
519 During the restart of a crashed primary node, all blocks covered by
520 the activity log are marked for resync. But a large part of those
521 will actually be still in sync, therefore using csums-alg will
522 lower the required bandwidth in exchange for CPU cycles.
523
524 -R, --use-rle
525 During resync-handshake, the dirty-bitmaps of the nodes are
526 exchanged and merged (using bit-or), so the nodes will have the
527 same understanding of which blocks are dirty. On large devices, the
528 fine grained dirty-bitmap can become large as well, and the bitmap
529 exchange can take quite some time on low-bandwidth links.
530
531 Because the bitmap typically contains compact areas where all bits
532 are unset (clean) or set (dirty), a simple run-length encoding
533 scheme can considerably reduce the network traffic necessary for
534 the bitmap exchange.
535
536 For backward compatibilty reasons, and because on fast links this
537 possibly does not improve transfer time but consumes cpu cycles,
538 this defaults to off.
539
540 Introduced in 8.3.2.
541
542 -V, --delay-probe-volume volume, -I, --delay-probe-interval interval,
543 -T, --throttle-threshold throttle_delay, -H, --hold-off-threshold
544 hold_off_delay
545 During resync at least every volume bytes of data and at least
546 every interval * 100ms a pair of delay probes get inserted in
547 DRBD's packet stream. Those packets are used to measure the delay
548 of packts on the data socket caused by queuing in various network
549 components along the path.
550
551 If the delay on the data socket becomes greater than throttle_delay
552 DRBD will slow down the resync in order to keep the delay small.
553 The resync speed gets linearly slowed down it reaches 0 at a delay
554 of hold_off_delay.
555
556 The default value of volume is 16384 (16 MiB), the default unit is
557 KiB. Interval has 5 (500ms), throttle_delay 20 (2 seconds),
558 hold_off_delay 100 (10 seconds) as default value. The default unit
559 of the latter three is 100ms.
560
561 primary
562 Sets the device into primary role. This means that applications (e.g. a
563 file system) may open the device for read and write access. Data
564 written to the device in primary role are mirrored to the device in
565 secondary role.
566
567 Normally it is not possible to set both devices of a connected DRBD
568 device pair to primary role. By using the --allow-two-primaries option,
569 you override this behavior and instruct DRBD to allow two primaries.
570
571 -o, --overwrite-data-of-peer
572 Alias for --force.
573
574 -f, --force
575 Becoming primary fails if the local replica is not up-to-date. I.e.
576 when it is inconsistent, outdated of consistent. By using this
577 option you can force it into primary role anyway. USE THIS OPTION
578 ONLY IF YOU KNOW WHAT YOU ARE DOING.
579
580 secondary
581 Brings the device into secondary role. This operation fails as long as
582 at least one application (or file system) has opened the device.
583
584 It is possible that both devices of a connected DRBD device pair are
585 secondary.
586
587 verify
588 This initiates on-line device verification. During on-line
589 verification, the contents of every block on the local node are
590 compared to those on the peer node. Device verification progress can be
591 monitored via /proc/drbd. Any blocks whose content differs from that of
592 the corresponding block on the peer node will be marked out-of-sync in
593 DRBD's on-disk bitmap; they are not brought back in sync automatically.
594 To do that, simply disconnect and reconnect the resource.
595
596 If on-line verification is already in progress, this command silently
597 does nothing.
598
599 This command will fail if the device is not part of a connected device
600 pair.
601
602 See also the notes on data integrity on the drbd.conf manpage.
603
604 -s, --start start-sector
605 Since version 8.3.2, on-line verification should resume from the
606 last position after connection loss. It may also be started from an
607 arbitrary position by setting this option.
608
609 Default unit is sectors. You may also specify a unit explicitly.
610 The start-sector will be rounded down to a multiple of 8 sectors
611 (4kB).
612
613 invalidate
614 This forces the local device of a pair of connected DRBD devices into
615 SyncTarget state, which means that all data blocks of the device are
616 copied over from the peer.
617
618 This command will fail if the device is not part of a connected device
619 pair.
620
621 invalidate-remote
622 This forces the local device of a pair of connected DRBD devices into
623 SyncSource state, which means that all data blocks of the device are
624 copied to the peer.
625
626 wait-connect
627 Returns as soon as the device can communicate with its partner device.
628
629 -t, --wfc-timeout wfc_timeout, -d, --degr-wfc-timeout degr_wfc_timeout,
630 -o, --outdated-wfc-timeout outdated_wfc_timeout, -w, --wait-after-sb
631 This command will fail if the device cannot communicate with its
632 partner for timeout seconds. If the peer was working before this
633 node was rebooted, the wfc_timeout is used. If the peer was already
634 down before this node was rebooted, the degr_wfc_timeout is used.
635 If the peer was sucessfully outdated before this node was rebooted
636 the outdated_wfc_timeout is used. The default value for all those
637 timeout values is 0 which means to wait forever. In case the
638 connection status goes down to StandAlone because the peer appeared
639 but the devices had a split brain situation, the default for the
640 command is to terminate. You can change this behavior with the
641 --wait-after-sb option.
642
643 wait-sync
644 Returns as soon as the device leaves any synchronization into connected
645 state. The options are the same as with the wait-connect command.
646
647 disconnect
648 Removes the information set by the net command from the device. This
649 means that the device goes into unconnected state and will no longer
650 listen for incoming connections.
651
652 detach
653 Removes the information set by the disk command from the device. This
654 means that the device is detached from its backing storage device.
655
656 down
657 Removes all configuration information from the device and forces it
658 back to unconfigured state.
659
660 role
661 Shows the current roles of the device and its peer, as local/peer.
662
663 state
664 Deprecated alias for "role"
665
666 cstate
667 Shows the current connection state of the device.
668
669 dstate
670 Shows the current states of the backing storage devices, as local/peer.
671
672 status
673 Shows the current status of the device in XML-like format. Example
674 output:
675
676 <resource minor="0" name="s0" cs="SyncTarget" st1="Secondary" st2="Secondary"
677 ds1="Inconsistent" ds2="UpToDate" resynced_precent="5.9" />
678
679
680 resize
681 This causes DRBD to reexamine the size of the device's backing storage
682 device. To actually do online growing you need to extend the backing
683 storages on both devices and call the resize command on one of your
684 nodes.
685
686 The --assume-peer-has-space allows you to resize a device which is
687 currently not connected to the peer. Use with care, since if you do not
688 resize the peer's disk as well, further connect attempts of the two
689 will fail.
690
691 When the --assume-clean option is given DRBD will skip the resync of
692 the new storage. Only do this if you know that the new storage was
693 initialized to the same content by other means.
694
695 check-resize
696 To enable DRBD to detect offline resizing of backing devices this
697 command may be used to record the current size of backing devices. The
698 size is stored in files in /var/lib/drbd/ named drbd-minor-??.lkbd
699
700 This command is called by drbdadm resize res after drbdsetup device
701 resize returned.
702
703 pause-sync
704 Temporarily suspend an ongoing resynchronization by setting the local
705 pause flag. Resync only progresses if neither the local nor the remote
706 pause flag is set. It might be desirable to postpone DRBD's
707 resynchronization after eventual resynchronization of the backing
708 storage's RAID setup.
709
710 resume-sync
711 Unset the local sync pause flag.
712
713 outdate
714 Mark the data on the local backing storage as outdated. An outdated
715 device refuses to become primary. This is used in conjunction with
716 fencing and by the peer's fence-peer handler.
717
718 show-gi
719 Displays the device's data generation identifiers verbosely.
720
721 get-gi
722 Displays the device's data generation identifiers.
723
724 show
725 Shows all available configuration information of the device.
726
727 suspend-io
728 This command is of no apparent use and just provided for the sake of
729 completeness.
730
731 resume-io
732 If the fence-peer handler fails to stonith the peer node, and your
733 fencing policy is set to resource-and-stonith, you can unfreeze IO
734 operations with this command.
735
736 events
737 Displays every state change of DRBD and all calls to helper programs.
738 This might be used to get notified of DRBD's state changes by piping
739 the output to another program.
740
741 -a, --all-devices
742 Display the events of all DRBD minors.
743
744 -u, --unfiltered
745 This is a debugging aid that displays the content of all received
746 netlink messages.
747
748 new-current-uuid
749 Generates a new current UUID and rotates all other UUID values. This
750 has at least two use cases, namely to skip the initial sync, and to
751 reduce network bandwidth when starting in a single node configuration
752 and then later (re-)integrating a remote site.
753
754 Available option:
755
756 -c, --clear-bitmap
757 Clears the sync bitmap in addition to generating a new current
758 UUID.
759
760 This can be used to skip the initial sync, if you want to start from
761 scratch. This use-case does only work on "Just Created" meta data.
762 Necessary steps:
763
764 1. On both nodes, initialize meta data and configure the device.
765
766 drbdadm -- --force create-md res
767
768 2. They need to do the initial handshake, so they know their sizes.
769
770 drbdadm up res
771
772 3. They are now Connected Secondary/Secondary
773 Inconsistent/Inconsistent. Generate a new current-uuid and clear
774 the dirty bitmap.
775
776 drbdadm -- --clear-bitmap new-current-uuid res
777
778 4. They are now Connected Secondary/Secondary UpToDate/UpToDate. Make
779 one side primary and create a file system.
780
781 drbdadm primary res
782
783 mkfs -t fs-type $(drbdadm sh-dev res)
784
785 One obvious side-effect is that the replica is full of old garbage
786 (unless you made them identical using other means), so any
787 online-verify is expected to find any number of out-of-sync blocks.
788
789 You must not use this on pre-existing data! Even though it may appear
790 to work at first glance, once you switch to the other node, your data
791 is toast, as it never got replicated. So do not leave out the mkfs (or
792 equivalent).
793
794 This can also be used to shorten the initial resync of a cluster where
795 the second node is added after the first node is gone into production,
796 by means of disk shipping. This use-case works on disconnected devices
797 only, the device may be in primary or secondary role.
798
799 The necessary steps on the current active server are:
800
801 1. drbdsetup device new-current-uuid --clear-bitmap
802
803 2. Take the copy of the current active server. E.g. by pulling a disk
804 out of the RAID1 controller, or by copying with dd. You need to
805 copy the actual data, and the meta data.
806
807 3. drbdsetup device new-current-uuid
808
809 Now add the disk to the new secondary node, and join it to the cluster.
810 You will get a resync of that parts that were changed since the first
811 call to drbdsetup in step 1.
812
814 For examples, please have a look at the DRBD User's Guide[1].
815
817 This document was revised for version 8.3.2 of the DRBD distribution.
818
820 Written by Philipp Reisner philipp.reisner@linbit.com and Lars
821 Ellenberg lars.ellenberg@linbit.com
822
824 Report bugs to drbd-user@lists.linbit.com.
825
827 Copyright 2001-2008 LINBIT Information Technologies, Philipp Reisner,
828 Lars Ellenberg. This is free software; see the source for copying
829 conditions. There is NO warranty; not even for MERCHANTABILITY or
830 FITNESS FOR A PARTICULAR PURPOSE.
831
833 drbd.conf(5), drbd(8), drbddisk(8), drbdadm(8), DRBD User's Guide[1],
834 DRBD web site[2]
835
837 1. DRBD User's Guide
838 http://www.drbd.org/users-guide/
839
840 2. DRBD web site
841 http://www.drbd.org/
842
843
844
845DRBD 8.3.2 5 Dec 2008 DRBDSETUP(8)