1DRBDSETUP(8)                 System Administration                DRBDSETUP(8)
2
3
4

NAME

6       drbdsetup - Setup tool for DRBD
7

SYNOPSIS

9       drbdsetup new-resource resource [--cpu-mask {val}]
10                 [--on-no-data-accessible {io-error | suspend-io}]
11
12       drbdsetup new-minor resource minor volume
13
14       drbdsetup del-resource resource
15
16       drbdsetup del-minor minor
17
18       drbdsetup attach minor lower_dev meta_data_dev meta_data_index
19                 [--size {val}] [--max-bio-bvecs {val}]
20                 [--on-io-error {pass_on | call-local-io-error | detach}]
21                 [--fencing {dont-care | resource-only | resource-and-stonith}]
22                 [--disk-barrier] [--disk-flushes] [--disk-drain]
23                 [--md-flushes] [--resync-rate {val}] [--resync-after {val}]
24                 [--al-extents {val}] [--al-updates]
25                 [--discard-zeroes-if-aligned] [--disable-write-same]
26                 [--c-plan-ahead {val}] [--c-delay-target {val}]
27                 [--c-fill-target {val}] [--c-max-rate {val}]
28                 [--c-min-rate {val}] [--disk-timeout {val}]
29                 [--read-balancing {prefer-local | prefer-remote | round-robin | least-pending | when-congested-remote | 32K-striping | 64K-striping | 128K-striping | 256K-striping | 512K-striping | 1M-striping}]
30                 [--rs-discard-granularity {val}]
31
32       drbdsetup connect resource local_addr remote_addr [--tentative]
33                 [--discard-my-data] [--protocol {A | B | C}]
34                 [--timeout {val}] [--max-epoch-size {val}]
35                 [--max-buffers {val}] [--unplug-watermark {val}]
36                 [--connect-int {val}] [--ping-int {val}]
37                 [--sndbuf-size {val}] [--rcvbuf-size {val}]
38                 [--ko-count {val}] [--allow-two-primaries]
39                 [--cram-hmac-alg {val}] [--shared-secret {val}]
40                 [--after-sb-0pri {disconnect | discard-younger-primary | discard-older-primary | discard-zero-changes | discard-least-changes | discard-local | discard-remote}]
41                 [--after-sb-1pri {disconnect | consensus | discard-secondary | call-pri-lost-after-sb | violently-as0p}]
42                 [--after-sb-2pri {disconnect | call-pri-lost-after-sb | violently-as0p}]
43                 [--always-asbp]
44                 [--rr-conflict {disconnect | call-pri-lost | violently}]
45                 [--ping-timeout {val}] [--data-integrity-alg {val}]
46                 [--tcp-cork]
47                 [--on-congestion {block | pull-ahead | disconnect}]
48                 [--congestion-fill {val}] [--congestion-extents {val}]
49                 [--csums-alg {val}] [--csums-after-crash-only]
50                 [--verify-alg {val}] [--use-rle]
51                 [--socket-check-timeout {val}]
52
53       drbdsetup disk-options minor
54                 [--on-io-error {pass_on | call-local-io-error | detach}]
55                 [--fencing {dont-care | resource-only | resource-and-stonith}]
56                 [--disk-barrier] [--disk-flushes] [--disk-drain]
57                 [--md-flushes] [--resync-rate {val}] [--resync-after {val}]
58                 [--al-extents {val}] [--al-updates]
59                 [--discard-zeroes-if-aligned] [--disable-write-same]
60                 [--c-plan-ahead {val}] [--c-delay-target {val}]
61                 [--c-fill-target {val}] [--c-max-rate {val}]
62                 [--c-min-rate {val}] [--disk-timeout {val}]
63                 [--read-balancing {prefer-local | prefer-remote | round-robin | least-pending | when-congested-remote | 32K-striping | 64K-striping | 128K-striping | 256K-striping | 512K-striping | 1M-striping}]
64                 [--rs-discard-granularity {val}]
65
66       drbdsetup net-options local_addr remote_addr [--protocol {A | B | C}]
67                 [--timeout {val}] [--max-epoch-size {val}]
68                 [--max-buffers {val}] [--unplug-watermark {val}]
69                 [--connect-int {val}] [--ping-int {val}]
70                 [--sndbuf-size {val}] [--rcvbuf-size {val}]
71                 [--ko-count {val}] [--allow-two-primaries]
72                 [--cram-hmac-alg {val}] [--shared-secret {val}]
73                 [--after-sb-0pri {disconnect | discard-younger-primary | discard-older-primary | discard-zero-changes | discard-least-changes | discard-local | discard-remote}]
74                 [--after-sb-1pri {disconnect | consensus | discard-secondary | call-pri-lost-after-sb | violently-as0p}]
75                 [--after-sb-2pri {disconnect | call-pri-lost-after-sb | violently-as0p}]
76                 [--always-asbp]
77                 [--rr-conflict {disconnect | call-pri-lost | violently}]
78                 [--ping-timeout {val}] [--data-integrity-alg {val}]
79                 [--tcp-cork]
80                 [--on-congestion {block | pull-ahead | disconnect}]
81                 [--congestion-fill {val}] [--congestion-extents {val}]
82                 [--csums-alg {val}] [--csums-after-crash-only]
83                 [--verify-alg {val}] [--use-rle]
84                 [--socket-check-timeout {val}]
85
86       drbdsetup resource-options resource [--cpu-mask {val}]
87                 [--on-no-data-accessible {io-error | suspend-io}]
88
89       drbdsetup disconnect local_addr remote_addr [--force]
90
91       drbdsetup detach minor [--force]
92
93       drbdsetup primary minor [--force]
94
95       drbdsetup secondary minor
96
97       drbdsetup down resource
98
99       drbdsetup verify minor [--start {val}] [--stop {val}]
100
101       drbdsetup invalidate minor
102
103       drbdsetup invalidate-remote minor
104
105       drbdsetup wait-connect minor [--wfc-timeout {val}]
106                 [--degr-wfc-timeout {val}] [--outdated-wfc-timeout {val}]
107                 [--wait-after-sb {val}]
108
109       drbdsetup wait-sync minor [--wfc-timeout {val}]
110                 [--degr-wfc-timeout {val}] [--outdated-wfc-timeout {val}]
111                 [--wait-after-sb {val}]
112
113       drbdsetup role minor
114
115       drbdsetup cstate minor
116
117       drbdsetup dstate minor
118
119       drbdsetup resize minor [--size {val}] [--assume-peer-has-space]
120                 [--assume-clean] [--al-stripes {val}]
121                 [--al-stripe-size-kB {val}]
122
123       drbdsetup check-resize minor
124
125       drbdsetup pause-sync minor
126
127       drbdsetup resume-sync minor
128
129       drbdsetup outdate minor
130
131       drbdsetup show-gi minor
132
133       drbdsetup get-gi minor
134
135       drbdsetup show {resource | minor | all}
136
137       drbdsetup suspend-io minor
138
139       drbdsetup resume-io minor
140
141       drbdsetup status {resource | all} [--color {val}]
142
143       drbdsetup events2 {resource | all}
144
145       drbdsetup events {resource | minor | all}
146
147       drbdsetup new-current-uuid minor [--clear-bitmap]
148

DESCRIPTION

150       drbdsetup is used to associate DRBD devices with their backing block
151       devices, to set up DRBD device pairs to mirror their backing block
152       devices, and to inspect the configuration of running DRBD devices.
153

NOTE

155       drbdsetup is a low level tool of the DRBD program suite. It is used by
156       the data disk and drbd scripts to communicate with the device driver.
157

COMMANDS

159       Each drbdsetup sub-command might require arguments and bring its own
160       set of options. All values have default units which might be overruled
161       by K, M or G. These units are defined in the usual way (e.g. K = 2^10 =
162       1024).
163
164   Common options
165       All drbdsetup sub-commands accept these two options
166
167       --create-device
168           In case the specified DRBD device (minor number) does not exist
169           yet, create it implicitly.
170
171   new-resource
172       Resources are the primary objects of any DRBD configuration. A resource
173       must be created with the new-resource command before any volumes or
174       minor devices can be created. Connections are referenced by name.
175
176   new-minor
177       A minor is used as a synonym for replicated block device. It is
178       represented in the /dev/ directory by a block device. It is the
179       application's interface to the DRBD-replicated block devices. These
180       block devices get addressed by their minor numbers on the drbdsetup
181       commandline.
182
183       A pair of replicated block devices may have different minor numbers on
184       the two machines. They are associated by a common volume-number. Volume
185       numbers are local to each connection. Minor numbers are global on one
186       node.
187
188   del-resource
189       Destroys a resource object. This is only possible if the resource has
190       no volumes.
191
192   del-minor
193       Minors can only be destroyed if its disk is detached.
194
195   attach, disk-options
196       Attach associates device with lower_device to store its data blocks on.
197       The -d (or --disk-size) should only be used if you wish not to use as
198       much as possible from the backing block devices. If you do not use -d,
199       the device is only ready for use as soon as it was connected to its
200       peer once. (See the net command.)
201
202       With the disk-options command it is possible to change the options of a
203       minor while it is attached.
204
205       --disk-size size
206           You can override DRBD's size determination method with this option.
207           If you need to use the device before it was ever connected to its
208           peer, use this option to pass the size of the DRBD device to the
209           driver. Default unit is sectors (1s = 512 bytes).
210
211           If you use the size parameter in drbd.conf, we strongly recommend
212           to add an explicit unit postfix. drbdadm and drbdsetup used to have
213           mismatching default units.
214
215       --on-io-error err_handler
216           If the driver of the lower_device reports an error to DRBD, DRBD
217           will mark the disk as inconsistent, call a helper program, or
218           detach the device from its backing storage and perform all further
219           IO by requesting it from the peer. The valid err_handlers are:
220           pass_on, call-local-io-error and detach.
221
222       --fencing fencing_policy
223           Under fencing we understand preventive measures to avoid situations
224           where both nodes are primary and disconnected (AKA split brain).
225
226           Valid fencing policies are:
227
228           dont-care
229               This is the default policy. No fencing actions are done.
230
231           resource-only
232               If a node becomes a disconnected primary, it tries to outdate
233               the peer's disk. This is done by calling the fence-peer
234               handler. The handler is supposed to reach the other node over
235               alternative communication paths and call 'drbdadm outdate res'
236               there.
237
238           resource-and-stonith
239               If a node becomes a disconnected primary, it freezes all its IO
240               operations and calls its fence-peer handler. The fence-peer
241               handler is supposed to reach the peer over alternative
242               communication paths and call 'drbdadm outdate res' there. In
243               case it cannot reach the peer, it should stonith the peer. IO
244               is resumed as soon as the situation is resolved. In case your
245               handler fails, you can resume IO with the resume-io command.
246
247       --disk-barrier,
248       --disk-flushes,
249       --disk-drain
250           DRBD has four implementations to express write-after-write
251           dependencies to its backing storage device. DRBD will use the first
252           method that is supported by the backing storage device and that is
253           not disabled. By default the flush method is used.
254
255           Since drbd-8.4.2 disk-barrier is disabled by default because since
256           linux-2.6.36 (or 2.6.32 RHEL6) there is no reliable way to
257           determine if queuing of IO-barriers works.  Dangerous only enable
258           if you are told so by one that knows for sure.
259
260           When selecting the method you should not only base your decision on
261           the measurable performance. In case your backing storage device has
262           a volatile write cache (plain disks, RAID of plain disks) you
263           should use one of the first two. In case your backing storage
264           device has battery-backed write cache you may go with option 3.
265           Option 4 (disable everything, use "none") is dangerous on most IO
266           stacks, may result in write-reordering, and if so, can
267           theoretically be the reason for data corruption, or disturb the
268           DRBD protocol, causing spurious disconnect/reconnect cycles.  Do
269           not use no-disk-drain.
270
271           Unfortunately device mapper (LVM) might not support barriers.
272
273           The letter after "wo:" in /proc/drbd indicates with method is
274           currently in use for a device: b, f, d, n. The implementations:
275
276           barrier
277               The first requires that the driver of the backing storage
278               device support barriers (called 'tagged command queuing' in
279               SCSI and 'native command queuing' in SATA speak). The use of
280               this method can be enabled by setting the disk-barrier options
281               to yes.
282
283           flush
284               The second requires that the backing device support disk
285               flushes (called 'force unit access' in the drive vendors
286               speak). The use of this method can be disabled setting
287               disk-flushes to no.
288
289           drain
290               The third method is simply to let write requests drain before
291               write requests of a new reordering domain are issued. That was
292               the only implementation before 8.0.9.
293
294           none
295               The fourth method is to not express write-after-write
296               dependencies to the backing store at all, by also specifying
297               --no-disk-drain. This is dangerous on most IO stacks, may
298               result in write-reordering, and if so, can theoretically be the
299               reason for data corruption, or disturb the DRBD protocol,
300               causing spurious disconnect/reconnect cycles.  Do not use
301               --no-disk-drain.
302
303       --md-flushes
304           Disables the use of disk flushes and barrier BIOs when accessing
305           the meta data device. See the notes on --disk-flushes.
306
307       --max-bio-bvecs
308           In some special circumstances the device mapper stack manages to
309           pass BIOs to DRBD that violate the constraints that are set forth
310           by DRBD's merge_bvec() function and which have more than one bvec.
311           A known example is: phys-disk -> DRBD -> LVM -> Xen -> misaligned
312           partition (63) -> DomU FS. Then you might see "bio would need to,
313           but cannot, be split:" in the Dom0's kernel log.
314
315           The best workaround is to proper align the partition within the VM
316           (E.g. start it at sector 1024). That costs 480 KiB of storage.
317           Unfortunately the default of most Linux partitioning tools is to
318           start the first partition at an odd number (63). Therefore most
319           distributions install helpers for virtual linux machines will end
320           up with misaligned partitions. The second best workaround is to
321           limit DRBD's max bvecs per BIO (i.e., the max-bio-bvecs option) to
322           1, but that might cost performance.
323
324           The default value of max-bio-bvecs is 0, which means that there is
325           no user imposed limitation.
326
327       --resync-rate rate
328           To ensure smooth operation of the application on top of DRBD, it is
329           possible to limit the bandwidth that may be used by background
330           synchronization. The default is 250 KiB/sec, the default unit is
331           KiB/sec.
332
333       --resync-after minor
334           Start resync on this device only if the device with minor is
335           already in connected state. Otherwise this device waits in
336           SyncPause state.
337
338       --al-extents extents
339           DRBD automatically performs hot area detection. With this parameter
340           you control how big the hot area (=active set) can get. Each extent
341           marks 4M of the backing storage. In case a primary node leaves the
342           cluster unexpectedly, the areas covered by the active set must be
343           resynced upon rejoining of the failed node. The data structure is
344           stored in the meta-data area, therefore each change of the active
345           set is a write operation to the meta-data device. A higher number
346           of extents gives longer resync times but less updates to the
347           meta-data. The default number of extents is 1237. (Minimum: 7,
348           Maximum: 65534)
349
350           See also drbd.conf(5) and drbdmeta(8) for additional limitations
351           and necessary preparation.
352
353       --al-updates {yes | no}
354           DRBD's activity log transaction writing makes it possible, that
355           after the crash of a primary node a partial (bit-map based) resync
356           is sufficient to bring the node back to up-to-date. Setting
357           al-updates to no might increase normal operation performance but
358           causes DRBD to do a full resync when a crashed primary gets
359           reconnected. The default value is yes.
360
361       --c-plan-ahead plan_time,
362       --c-fill-target fill_target,
363       --c-delay-target delay_target,
364       --c-max-rate max_rate
365           The dynamic resync speed controller gets enabled with setting
366           plan_time to a positive value. It aims to fill the buffers along
367           the data path with either a constant amount of data fill_target, or
368           aims to have a constant delay time of delay_target along the path.
369           The controller has an upper bound of max_rate.
370
371           By plan_time the agility of the controller is configured. Higher
372           values yield for slower/lower responses of the controller to
373           deviation from the target value. It should be at least 5 times RTT.
374           For regular data paths a fill_target in the area of 4k to 100k is
375           appropriate. For a setup that contains drbd-proxy it is advisable
376           to use delay_target instead. Only when fill_target is set to 0 the
377           controller will use delay_target. 5 times RTT is a reasonable
378           starting value.  Max_rate should be set to the bandwidth available
379           between the DRBD-hosts and the machines hosting DRBD-proxy, or to
380           the available disk-bandwidth.
381
382           The default value of plan_time is 0, the default unit is 0.1
383           seconds.  Fill_target has 0 and sectors as default unit.
384           Delay_target has 1 (100ms) and 0.1 as default unit.  Max_rate has
385           10240 (100MiB/s) and KiB/s as default unit.
386
387       --c-min-rate min_rate
388           We track the disk IO rate caused by the resync, so we can detect
389           non-resync IO on the lower level device. If the lower level device
390           seems to be busy, and the current resync rate is above min_rate, we
391           throttle the resync.
392
393           The default value of min_rate is 4M, the default unit is k. If you
394           want to not throttle at all, set it to zero, if you want to
395           throttle always, set it to one.
396
397       -t, --disk-timeout disk_timeout
398           If the lower-level device on which a DRBD device stores its data
399           does not finish an I/O request within the defined disk-timeout,
400           DRBD treats this as a failure. The lower-level device is detached,
401           and the device's disk state advances to Diskless. If DRBD is
402           connected to one or more peers, the failed request is passed on to
403           one of them.
404
405           This option is dangerous and may lead to kernel panic!
406
407           "Aborting" requests, or force-detaching the disk, is intended for
408           completely blocked/hung local backing devices which do no longer
409           complete requests at all, not even do error completions. In this
410           situation, usually a hard-reset and failover is the only way out.
411
412           By "aborting", basically faking a local error-completion, we allow
413           for a more graceful swichover by cleanly migrating services. Still
414           the affected node has to be rebooted "soon".
415
416           By completing these requests, we allow the upper layers to re-use
417           the associated data pages.
418
419           If later the local backing device "recovers", and now DMAs some
420           data from disk into the original request pages, in the best case it
421           will just put random data into unused pages; but typically it will
422           corrupt meanwhile completely unrelated data, causing all sorts of
423           damage.
424
425           Which means delayed successful completion, especially for READ
426           requests, is a reason to panic(). We assume that a delayed *error*
427           completion is OK, though we still will complain noisily about it.
428
429           The default value of disk-timeout is 0, which stands for an
430           infinite timeout. Timeouts are specified in units of 0.1 seconds.
431           This option is available since DRBD 8.3.12.
432
433       --discard-zeroes-if-aligned {yes | no}
434           Setting discard-zeroes-if-aligned to no will cause DRBD to always
435           fall-back to zero-out on the receiving side, and to not even
436           announce discard capabilities on the Primary, if the respective
437           backend announces discard_zeroes_data=false.
438
439           Setting discards-zeroes-if-aligned to yes will allow DRBD to use
440           discards, and to announce discard_zeroes=true, even on backends
441           that announce discard_zeroes_data=false.
442
443           We used to ignore the discard_zeroes_data setting completely. To
444           not break established and expected behaviour, the default value is
445           yes.
446
447           This option is available since 8.4.7. See also drbd.conf(5).
448
449       --read-balancing method
450           The supported methods for load balancing of read requests are
451           prefer-local, prefer-remote, round-robin, least-pending and
452           when-congested-remote, 32K-striping, 64K-striping, 128K-striping,
453           256K-striping, 512K-striping and 1M-striping.
454
455           The default value of is prefer-local. This option is available
456           since 8.4.1.
457
458       --rs-discard-granularity bytes
459           When rs-discard-granularity is set to a non zero, positive value
460           then DRBD tries to do a resync operation in requests of this size.
461           In case such a block contains only zero bytes on the sync source
462           node, the sync target node will issue a discard/trim/unmap command
463           for the area.
464
465           The value is constrained by the discard granularity of the backing
466           block device. In case rs-discard-granularity is not a multiplier of
467           the discard granularity of the backing block device DRBD rounds it
468           up. The feature only gets active if the backing block device reads
469           back zeroes after a discard command.
470
471           The default value of is 0. This option is available since 8.4.7.
472
473   connect, net-options
474       Connect sets up the device to listen on af:local_addr:port for incoming
475       connections and to try to connect to af:remote_addr:port. If port is
476       omitted, 7788 is used as default. If af is omitted ipv4 gets used.
477       Other supported address families are ipv6, ssocks for Dolphin
478       Interconnect Solutions' "super sockets" and sdp for Sockets Direct
479       Protocol (Infiniband).
480
481       The net-options command allows you to change options while the
482       connection is established.
483
484       --protocol protocol
485           On the TCP/IP link the specified protocol is used. Valid protocol
486           specifiers are A, B, and C.
487
488           Protocol A: write IO is reported as completed, if it has reached
489           local disk and local TCP send buffer.
490
491           Protocol B: write IO is reported as completed, if it has reached
492           local disk and remote buffer cache.
493
494           Protocol C: write IO is reported as completed, if it has reached
495           both local and remote disk.
496
497       --connect-int time
498           In case it is not possible to connect to the remote DRBD device
499           immediately, DRBD keeps on trying to connect. With this option you
500           can set the time between two retries. The default value is 10. The
501           unit is seconds.
502
503       --ping-int time
504           If the TCP/IP connection linking a DRBD device pair is idle for
505           more than time seconds, DRBD will generate a keep-alive packet to
506           check if its partner is still alive. The default value is 10. The
507           unit is seconds.
508
509       --timeout val
510           If the partner node fails to send an expected response packet
511           within val tenths of a second, the partner node is considered dead
512           and therefore the TCP/IP connection is abandoned. The default value
513           is 60 (= 6 seconds).
514
515       --sndbuf-size size
516           The socket send buffer is used to store packets sent to the
517           secondary node, which are not yet acknowledged (from a network
518           point of view) by the secondary node. When using protocol A, it
519           might be necessary to increase the size of this data structure in
520           order to increase asynchronicity between primary and secondary
521           nodes. But keep in mind that more asynchronicity is synonymous with
522           more data loss in the case of a primary node failure. Since 8.0.13
523           resp. 8.2.7 setting the size value to 0 means that the kernel
524           should autotune this. The default size is 0, i.e. autotune.
525
526       --rcvbuf-size size
527           Packets received from the network are stored in the socket receive
528           buffer first. From there they are consumed by DRBD. Before 8.3.2
529           the receive buffer's size was always set to the size of the socket
530           send buffer. Since 8.3.2 they can be tuned independently. A value
531           of 0 means that the kernel should autotune this. The default size
532           is 0, i.e. autotune.
533
534       --ko-count count
535           In case the secondary node fails to complete a single write request
536           for count times the timeout, it is expelled from the cluster, i.e.
537           the primary node goes into StandAlone mode. To disable this
538           feature, you should explicitly set it to 0; defaults may change
539           between versions.
540
541       --max-epoch-size val
542           With this option the maximal number of write requests between two
543           barriers is limited. Typically set to the same as --max-buffers, or
544           the allowed maximum. Values smaller than 10 can lead to degraded
545           performance. The default value is 2048.
546
547       --max-buffers val
548           With this option the maximal number of buffer pages allocated by
549           DRBD's receiver thread is limited. Typically set to the same as
550           --max-epoch-size. Small values could lead to degraded performance.
551           The default value is 2048, the minimum 32. Increase this if you
552           cannot saturate the IO backend of the receiving side during linear
553           write or during resync while otherwise idle.
554
555           See also drbd.conf(5)
556
557       --unplug-watermark val
558           This setting has no effect with recent kernels that use explicit
559           on-stack plugging (upstream Linux kernel 2.6.39, distributions may
560           have backported).
561
562           When the number of pending write requests on the standby
563           (secondary) node exceeds the unplug-watermark, we trigger the
564           request processing of our backing storage device. Some storage
565           controllers deliver better performance with small values, others
566           deliver best performance when the value is set to the same value as
567           max-buffers, yet others don't feel much effect at all. Minimum 16,
568           default 128, maximum 131072.
569
570       --allow-two-primaries
571           With this option set you may assign primary role to both nodes. You
572           only should use this option if you use a shared storage file system
573           on top of DRBD. At the time of writing the only ones are: OCFS2 and
574           GFS. If you use this option with any other file system, you are
575           going to crash your nodes and to corrupt your data!
576
577       --cram-hmac-alg alg
578           You need to specify the HMAC algorithm to enable peer
579           authentication at all. You are strongly encouraged to use peer
580           authentication. The HMAC algorithm will be used for the challenge
581           response authentication of the peer. You may specify any digest
582           algorithm that is named in /proc/crypto.
583
584       --shared-secret secret
585           The shared secret used in peer authentication. May be up to 64
586           characters.
587
588       --after-sb-0pri asb-0p-policy
589           possible policies are:
590
591           disconnect
592               No automatic resynchronization, simply disconnect.
593
594           discard-younger-primary
595               Auto sync from the node that was primary before the split-brain
596               situation occurred.
597
598           discard-older-primary
599               Auto sync from the node that became primary as second during
600               the split-brain situation.
601
602           discard-zero-changes
603               In case one node did not write anything since the split brain
604               became evident, sync from the node that wrote something to the
605               node that did not write anything. In case none wrote anything
606               this policy uses a random decision to perform a "resync" of 0
607               blocks. In case both have written something this policy
608               disconnects the nodes.
609
610           discard-least-changes
611               Auto sync from the node that touched more blocks during the
612               split brain situation.
613
614           discard-node-NODENAME
615               Auto sync to the named node.
616
617       --after-sb-1pri asb-1p-policy
618           possible policies are:
619
620           disconnect
621               No automatic resynchronization, simply disconnect.
622
623           consensus
624               Discard the version of the secondary if the outcome of the
625               after-sb-0pri algorithm would also destroy the current
626               secondary's data. Otherwise disconnect.
627
628           discard-secondary
629               Discard the secondary's version.
630
631           call-pri-lost-after-sb
632               Always honor the outcome of the after-sb-0pri algorithm. In
633               case it decides the current secondary has the correct data,
634               call the pri-lost-after-sb on the current primary.
635
636           violently-as0p
637               Always honor the outcome of the after-sb-0pri algorithm. In
638               case it decides the current secondary has the correct data,
639               accept a possible instantaneous change of the primary's data.
640
641       --after-sb-2pri asb-2p-policy
642           possible policies are:
643
644           disconnect
645               No automatic resynchronization, simply disconnect.
646
647           call-pri-lost-after-sb
648               Always honor the outcome of the after-sb-0pri algorithm. In
649               case it decides the current secondary has the right data, call
650               the pri-lost-after-sb on the current primary.
651
652           violently-as0p
653               Always honor the outcome of the after-sb-0pri algorithm. In
654               case it decides the current secondary has the right data,
655               accept a possible instantaneous change of the primary's data.
656
657       --always-asbp
658           Normally the automatic after-split-brain policies are only used if
659           current states of the UUIDs do not indicate the presence of a third
660           node.
661
662           With this option you request that the automatic after-split-brain
663           policies are used as long as the data sets of the nodes are somehow
664           related. This might cause a full sync, if the UUIDs indicate the
665           presence of a third node. (Or double faults have led to strange
666           UUID sets.)
667
668       --rr-conflict role-resync-conflict-policy
669           This option sets DRBD's behavior when DRBD deduces from its meta
670           data that a resynchronization is needed, and the SyncTarget node is
671           already primary. The possible settings are: disconnect,
672           call-pri-lost and violently. While disconnect speaks for itself,
673           with the call-pri-lost setting the pri-lost handler is called which
674           is expected to either change the role of the node to secondary, or
675           remove the node from the cluster. The default is disconnect.
676
677           With the violently setting you allow DRBD to force a primary node
678           into SyncTarget state. This means that the data exposed by DRBD
679           changes to the SyncSource's version of the data instantaneously.
680           USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.
681
682       --data-integrity-alg hash_alg
683           DRBD can ensure the data integrity of the user's data on the
684           network by comparing hash values. Normally this is ensured by the
685           16 bit checksums in the headers of TCP/IP packets. This option can
686           be set to any of the kernel's data digest algorithms. In a typical
687           kernel configuration you should have at least one of md5, sha1, and
688           crc32c available. By default this is not enabled.
689
690           See also the notes on data integrity on the drbd.conf manpage.
691
692       --no-tcp-cork
693           DRBD usually uses the TCP socket option TCP_CORK to hint to the
694           network stack when it can expect more data, and when it should
695           flush out what it has in its send queue. There is at least one
696           network stack that performs worse when one uses this hinting
697           method. Therefore we introduced this option, which disable the
698           setting and clearing of the TCP_CORK socket option by DRBD.
699
700       --ping-timeout ping_timeout
701           The time the peer has to answer to a keep-alive packet. In case the
702           peer's reply is not received within this time period, it is
703           considered dead. The default unit is tenths of a second, the
704           default value is 5 (for half a second).
705
706       --discard-my-data
707           Use this option to manually recover from a split-brain situation.
708           In case you do not have any automatic after-split-brain policies
709           selected, the nodes refuse to connect. By passing this option you
710           make this node a sync target immediately after successful connect.
711
712       --tentative
713           Causes DRBD to abort the connection process after the resync
714           handshake, i.e. no resync gets performed. You can find out which
715           resync DRBD would perform by looking at the kernel's log file.
716
717       --on-congestion congestion_policy,
718       --congestion-fill fill_threshold,
719       --congestion-extents active_extents_threshold
720           By default DRBD blocks when the available TCP send queue becomes
721           full. That means it will slow down the application that generates
722           the write requests that cause DRBD to send more data down that TCP
723           connection.
724
725           When DRBD is deployed with DRBD-proxy it might be more desirable
726           that DRBD goes into AHEAD/BEHIND mode shortly before the send queue
727           becomes full. In AHEAD/BEHIND mode DRBD does no longer replicate
728           data, but still keeps the connection open.
729
730           The advantage of the AHEAD/BEHIND mode is that the application is
731           not slowed down, even if DRBD-proxy's buffer is not sufficient to
732           buffer all write requests. The downside is that the peer node falls
733           behind, and that a resync will be necessary to bring it back into
734           sync. During that resync the peer node will have an inconsistent
735           disk.
736
737           Available congestion_policys are block and pull-ahead. The default
738           is block.  Fill_threshold might be in the range of 0 to 10GiBytes.
739           The default is 0 which disables the check.
740           Active_extents_threshold has the same limits as al-extents.
741
742           The AHEAD/BEHIND mode and its settings are available since DRBD
743           8.3.10.
744
745       --verify-alg hash-alg
746           During online verification (as initiated by the verify
747           sub-command), rather than doing a bit-wise comparison, DRBD applies
748           a hash function to the contents of every block being verified, and
749           compares that hash with the peer. This option defines the hash
750           algorithm being used for that purpose. It can be set to any of the
751           kernel's data digest algorithms. In a typical kernel configuration
752           you should have at least one of md5, sha1, and crc32c available. By
753           default this is not enabled; you must set this option explicitly in
754           order to be able to use on-line device verification.
755
756           See also the notes on data integrity on the drbd.conf manpage.
757
758       --csums-alg hash-alg
759           A resync process sends all marked data blocks from the source to
760           the destination node, as long as no csums-alg is given. When one is
761           specified the resync process exchanges hash values of all marked
762           blocks first, and sends only those data blocks over, that have
763           different hash values.
764
765           This setting is useful for DRBD setups with low bandwidth links.
766           During the restart of a crashed primary node, all blocks covered by
767           the activity log are marked for resync. But a large part of those
768           will actually be still in sync, therefore using csums-alg will
769           lower the required bandwidth in exchange for CPU cycles.
770
771       --use-rle
772           During resync-handshake, the dirty-bitmaps of the nodes are
773           exchanged and merged (using bit-or), so the nodes will have the
774           same understanding of which blocks are dirty. On large devices, the
775           fine grained dirty-bitmap can become large as well, and the bitmap
776           exchange can take quite some time on low-bandwidth links.
777
778           Because the bitmap typically contains compact areas where all bits
779           are unset (clean) or set (dirty), a simple run-length encoding
780           scheme can considerably reduce the network traffic necessary for
781           the bitmap exchange.
782
783           For backward compatibility reasons, and because on fast links this
784           possibly does not improve transfer time but consumes cpu cycles,
785           this defaults to off.
786
787           Introduced in 8.3.2.
788
789       --socket-check-timeout
790           In setups involving a DRBD-proxy and connections that experience a
791           lot of buffer-bloat it might be necessary to set ping-timeout to an
792           unusual high value. By default DRBD uses the same value to wait if
793           a newly established TCP-connection is stable. Since the DRBD-proxy
794           is usually located in the same data center such a long wait time
795           may hinder DRBD's connect process.
796
797           In such setups socket-check-timeout should be set to at least to
798           the round trip time between DRBD and DRBD-proxy. I.e. in most cases
799           to 1.
800
801           The default unit is tenths of a second, the default value is 0
802           (which causes DRBD to use the value of ping-timeout instead).
803           Introduced in 8.4.5.
804
805   resource-options
806       Changes the options of the resource at runtime.
807
808       --cpu-mask cpu-mask
809           Sets the cpu-affinity-mask for DRBD's kernel threads of this
810           device. The default value of cpu-mask is 0, which means that DRBD's
811           kernel threads should be spread over all CPUs of the machine. This
812           value must be given in hexadecimal notation. If it is too big it
813           will be truncated.
814
815       --on-no-data-accessible ond-policy
816           This setting controls what happens to IO requests on a degraded,
817           disk less node (I.e. no data store is reachable). The available
818           policies are io-error and suspend-io.
819
820           If ond-policy is set to suspend-io you can either resume IO by
821           attaching/connecting the last lost data storage, or by the drbdadm
822           resume-io res command. The latter will result in IO errors of
823           course.
824
825           The default is io-error. This setting is available since DRBD
826           8.3.9.
827
828   primary
829       Sets the device into primary role. This means that applications (e.g. a
830       file system) may open the device for read and write access. Data
831       written to the device in primary role are mirrored to the device in
832       secondary role.
833
834       Normally it is not possible to set both devices of a connected DRBD
835       device pair to primary role. By using the --allow-two-primaries option,
836       you override this behavior and instruct DRBD to allow two primaries.
837
838       --overwrite-data-of-peer
839           Alias for --force.
840
841       --force
842           Becoming primary fails if the local replica is not up-to-date. I.e.
843           when it is inconsistent, outdated of consistent. By using this
844           option you can force it into primary role anyway. USE THIS OPTION
845           ONLY IF YOU KNOW WHAT YOU ARE DOING.
846
847   secondary
848       Brings the device into secondary role. This operation fails as long as
849       at least one application (or file system) has opened the device.
850
851       It is possible that both devices of a connected DRBD device pair are
852       secondary.
853
854   verify
855       This initiates on-line device verification. During on-line
856       verification, the contents of every block on the local node are
857       compared to those on the peer node. Device verification progress can be
858       monitored via /proc/drbd. Any blocks whose content differs from that of
859       the corresponding block on the peer node will be marked out-of-sync in
860       DRBD's on-disk bitmap; they are not brought back in sync automatically.
861       To do that, simply disconnect and reconnect the resource.
862
863       If on-line verification is already in progress (and this node is
864       "VerifyS"), this command silently "succeeds". In this case, any
865       start-sector (see below) will be ignored, and any stop-sector (see
866       below) will be honored. This can be used to stop a running verify, or
867       to update/shorten/extend the coverage of the currently running verify.
868
869       This command will fail if the device is not part of a connected device
870       pair.
871
872       See also the notes on data integrity on the drbd.conf manpage.
873
874       --start start-sector
875           Since version 8.3.2, on-line verification should resume from the
876           last position after connection loss. It may also be started from an
877           arbitrary position by setting this option. If you had reached some
878           stop-sector before, and you do not specify an explicit
879           start-sector, verify should resume from the previous stop-sector.
880
881           Default unit is sectors. You may also specify a unit explicitly.
882           The start-sector will be rounded down to a multiple of 8 sectors
883           (4kB).
884
885       -S, --stop stop-sector
886           Since version 8.3.14, on-line verification can be stopped before it
887           reaches end-of-device.
888
889           Default unit is sectors. You may also specify a unit explicitly.
890           The stop-sector may be updated by issuing an additional drbdsetup
891           verify command on the same node while the verify is running. This
892           can be used to stop a running verify, or to update/shorten/extend
893           the coverage of the currently running verify.
894
895   invalidate
896       This forces the local device of a pair of connected DRBD devices into
897       SyncTarget state, which means that all data blocks of the device are
898       copied over from the peer.
899
900       This command will fail if the device is not either part of a connected
901       device pair, or disconnected Secondary.
902
903   invalidate-remote
904       This forces the local device of a pair of connected DRBD devices into
905       SyncSource state, which means that all data blocks of the device are
906       copied to the peer.
907
908       On a disconnected Primary device, this will set all bits in the out of
909       sync bitmap. As a side affect this suspends updates to the on disk
910       activity log. Updates to the on disk activity log resume automatically
911       when necessary.
912
913   wait-connect
914       Returns as soon as the device can communicate with its partner device.
915
916       --wfc-timeout wfc_timeout,
917       --degr-wfc-timeout degr_wfc_timeout,
918       --outdated-wfc-timeout outdated_wfc_timeout,
919       --wait-after-sb
920           This command will fail if the device cannot communicate with its
921           partner for timeout seconds. If the peer was working before this
922           node was rebooted, the wfc_timeout is used. If the peer was already
923           down before this node was rebooted, the degr_wfc_timeout is used.
924           If the peer was successfully outdated before this node was rebooted
925           the outdated_wfc_timeout is used. The default value for all those
926           timeout values is 0 which means to wait forever. The unit is
927           seconds. In case the connection status goes down to StandAlone
928           because the peer appeared but the devices had a split brain
929           situation, the default for the command is to terminate. You can
930           change this behavior with the --wait-after-sb option.
931
932   wait-sync
933       Returns as soon as the device leaves any synchronization into connected
934       state. The options are the same as with the wait-connect command.
935
936   disconnect
937       Removes the information set by the net command from the device. This
938       means that the device goes into unconnected state and will no longer
939       listen for incoming connections.
940
941   detach
942       Removes the information set by the disk command from the device. This
943       means that the device is detached from its backing storage device.
944
945       -f, --force
946           A regular detach returns after the disk state finally reached
947           diskless. As a consequence detaching from a frozen backing block
948           device never terminates.
949
950           On the other hand A forced detach returns immediately. It allows
951           you to detach DRBD from a frozen backing block device. Please note
952           that the disk will be marked as failed until all pending IO
953           requests where finished by the backing block device.
954
955   down
956       Removes all configuration information from the device and forces it
957       back to unconfigured state.
958
959   role
960       Shows the current roles of the device and its peer, as local/peer.
961
962   state
963       Deprecated alias for "role"
964
965   cstate
966       Shows the current connection state of the device.
967
968   dstate
969       Shows the current states of the backing storage devices, as local/peer.
970
971   resize
972       This causes DRBD to reexamine the size of the device's backing storage
973       device. To actually do online growing you need to extend the backing
974       storages on both devices and call the resize command on one of your
975       nodes.
976
977       The --size option can be used to online shrink the usable size of a
978       drbd device. It's the users responsibility to make sure that a file
979       system on the device is not truncated by that operation.
980
981       The --assume-peer-has-space allows you to resize a device which is
982       currently not connected to the peer. Use with care, since if you do not
983       resize the peer's disk as well, further connect attempts of the two
984       will fail.
985
986       When the --assume-clean option is given DRBD will skip the resync of
987       the new storage. Only do this if you know that the new storage was
988       initialized to the same content by other means.
989
990       The options --al-stripes and --al-stripe-size-kB may be used to change
991       the layout of the activity log online. In case of internal meta data
992       this may invovle shrinking the user visible size at the same time
993       (unsing the --size) or increasing the avalable space on the backing
994       devices.
995
996   check-resize
997       To enable DRBD to detect offline resizing of backing devices this
998       command may be used to record the current size of backing devices. The
999       size is stored in files in /var/lib/drbd/ named drbd-minor-??.lkbd
1000
1001       This command is called by drbdadm resize res after drbdsetup device
1002       resize returned.
1003
1004   pause-sync
1005       Temporarily suspend an ongoing resynchronization by setting the local
1006       pause flag. Resync only progresses if neither the local nor the remote
1007       pause flag is set. It might be desirable to postpone DRBD's
1008       resynchronization after eventual resynchronization of the backing
1009       storage's RAID setup.
1010
1011   resume-sync
1012       Unset the local sync pause flag.
1013
1014   outdate
1015       Mark the data on the local backing storage as outdated. An outdated
1016       device refuses to become primary. This is used in conjunction with
1017       fencing and by the peer's fence-peer handler.
1018
1019   show-gi
1020       Displays the device's data generation identifiers verbosely.
1021
1022   get-gi
1023       Displays the device's data generation identifiers.
1024
1025   show
1026       Shows all available configuration information of a resource, or of all
1027       resources. Available options:
1028
1029       --show-defaults
1030           Show all configuration parameters, even the ones with default
1031           values. Normally, parameters with default values are not shown.
1032
1033   suspend-io
1034       This command is of no apparent use and just provided for the sake of
1035       completeness.
1036
1037   resume-io
1038       If the fence-peer handler fails to stonith the peer node, and your
1039       fencing policy is set to resource-and-stonith, you can unfreeze IO
1040       operations with this command.
1041
1042   status
1043       Show the status of a resource, or of all resources. The output consists
1044       of one paragraph for each configured resource. Each paragraph contains
1045       one line for each resource, followed by one line for each device, and
1046       one line for each connection. The device and connection lines are
1047       indented. The connection lines are followed by one line for each peer
1048       device; these lines are indented against the connection line.
1049
1050       Long lines are wrapped around at terminal width, and indented to
1051       indicate how the lines belongs together. Available options:
1052
1053       --verbose
1054           Include more information in the output even when it is likely
1055           redundant or irrelevant.
1056
1057       --statistics
1058           Include data transfer statistics in the output.
1059
1060       --color={always | auto | never}
1061           Colorize the output. With --color=auto, drbdsetup emits color codes
1062           only when standard output is connected to a terminal.
1063
1064       For example, the non-verbose output for a resource with only one
1065       connection and only one volume could look like this:
1066
1067           fs-backoffice role:Primary
1068             disk:UpToDate
1069             peer role:Secondary
1070               replication:Established peer-disk:UpToDate
1071
1072
1073       With the --verbose --statistics options, the same resource could be
1074       reported as:
1075
1076           fs-data role:Primary suspended:no
1077               write-ordering:drain
1078             volume:0 minor:1 disk:UpToDate
1079                 size:10616472 read:134465 written:144800 al-writes:18 bm-writes:0
1080                 upper-pending:0 lower-pending:0 al-suspended:no blocked:no
1081             peer connection:Connected role:Secondary congested:no
1082               volume:0 replication:Established peer-disk:UpToDate resync-suspended:no
1083                   received:122596 sent:22204 out-of-sync:0 pending:0 unacked:0
1084
1085
1086
1087   events2
1088       Show the current state of all configured DRBD objects, followed by all
1089       changes to the state.
1090
1091       The output format is meant to be human as well as machine readable.
1092       Each line starts with the event number, which is followed by an
1093       asterisk if the event continues in the next line. The second word in
1094       each line indicates the kind of event: exists for an existing object;
1095       create, destroy, and change if an object is created, destroyed, or
1096       changed; or call or response if an event handler is called or it
1097       returns. The third word indicates the object the event applies to:
1098       resource, device, connection, peer-device, helper, or a dash (-) to
1099       indicate that the current state has been dumped completely.
1100
1101       The remaining words identify the object and describe the state that he
1102       object is in. Available options:
1103
1104       --now
1105           Terminate after reporting the current state. The default is to
1106           continuously listen and report state changes.
1107
1108       --statistics
1109           Include statistics in the output.
1110
1111   events
1112       Deprecated. If possible, change to the events2 subcommand instead.
1113
1114       Displays every state change of DRBD and all calls to helper programs.
1115       This might be used to get notified of DRBD's state changes by piping
1116       the output to another program.
1117
1118       --all-devices
1119           Display the events of all DRBD minors.
1120
1121       --unfiltered
1122           This is a debugging aid that displays the content of all received
1123           netlink messages.
1124
1125   new-current-uuid
1126       Generates a new current UUID and rotates all other UUID values. This
1127       has at least two use cases, namely to skip the initial sync, and to
1128       reduce network bandwidth when starting in a single node configuration
1129       and then later (re-)integrating a remote site.
1130
1131       Available option:
1132
1133       --clear-bitmap
1134           Clears the sync bitmap in addition to generating a new current
1135           UUID.
1136
1137       This can be used to skip the initial sync, if you want to start from
1138       scratch. This use-case does only work on "Just Created" meta data.
1139       Necessary steps:
1140
1141        1. On both nodes, initialize meta data and configure the device.
1142
1143           drbdadm -- --force create-md res
1144
1145        2. They need to do the initial handshake, so they know their sizes.
1146
1147           drbdadm up res
1148
1149        3. They are now Connected Secondary/Secondary
1150           Inconsistent/Inconsistent. Generate a new current-uuid and clear
1151           the dirty bitmap.
1152
1153           drbdadm new-current-uuid --clear-bitmap res
1154
1155        4. They are now Connected Secondary/Secondary UpToDate/UpToDate. Make
1156           one side primary and create a file system.
1157
1158           drbdadm primary res
1159
1160           mkfs -t fs-type $(drbdadm sh-dev res)
1161
1162       One obvious side-effect is that the replica is full of old garbage
1163       (unless you made them identical using other means), so any
1164       online-verify is expected to find any number of out-of-sync blocks.
1165
1166       You must not use this on pre-existing data!  Even though it may appear
1167       to work at first glance, once you switch to the other node, your data
1168       is toast, as it never got replicated. So do not leave out the mkfs (or
1169       equivalent).
1170
1171       This can also be used to shorten the initial resync of a cluster where
1172       the second node is added after the first node is gone into production,
1173       by means of disk shipping. This use-case works on disconnected devices
1174       only, the device may be in primary or secondary role.
1175
1176       The necessary steps on the current active server are:
1177
1178        1. drbdsetup new-current-uuid --clear-bitmap minor
1179
1180        2. Take the copy of the current active server. E.g. by pulling a disk
1181           out of the RAID1 controller, or by copying with dd. You need to
1182           copy the actual data, and the meta data.
1183
1184        3. drbdsetup new-current-uuid minor
1185
1186       Now add the disk to the new secondary node, and join it to the cluster.
1187       You will get a resync of that parts that were changed since the first
1188       call to drbdsetup in step 1.
1189

EXAMPLES

1191       For examples, please have a look at the DRBD User's Guide[1].
1192

VERSION

1194       This document was revised for version 8.3.2 of the DRBD distribution.
1195

AUTHOR

1197       Written by Philipp Reisner <philipp.reisner@linbit.com> and Lars
1198       Ellenberg <lars.ellenberg@linbit.com>
1199

REPORTING BUGS

1201       Report bugs to <drbd-user@lists.linbit.com>.
1202
1204       Copyright 2001-2008 LINBIT Information Technologies, Philipp Reisner,
1205       Lars Ellenberg. This is free software; see the source for copying
1206       conditions. There is NO warranty; not even for MERCHANTABILITY or
1207       FITNESS FOR A PARTICULAR PURPOSE.
1208

SEE ALSO

1210       drbd.conf(5), drbd(8), drbddisk(8), drbdadm(8), DRBD User's Guide[1],
1211       DRBD web site[2]
1212

NOTES

1214        1. DRBD User's Guide
1215           http://www.drbd.org/users-guide/
1216
1217        2. DRBD web site
1218           http://www.drbd.org/
1219
1220
1221
1222DRBD 8.4.0                        6 May 2011                      DRBDSETUP(8)
Impressum