<!DOCTYPE RefEntry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" []>
<refentry id="re-drbdsetup">
  <refentryinfo><date>15 Oct 2008</date></refentryinfo>

  <refmeta>
    <refentrytitle>drbdsetup</refentrytitle>
    <manvolnum>8</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>drbdsetup</refname>
    <refpurpose>Setup tool for DRBD</refpurpose>
    <indexterm><primary>drbdsetup</primary></indexterm>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">disk</arg>
      <arg choice="req"><replaceable>lower_dev</replaceable></arg>
      <arg choice="req"><replaceable>meta_data_dev</replaceable></arg>
      <arg choice="req"><replaceable>meta_data_index</replaceable></arg>
      <arg>-d<arg choice="req"><replaceable>size</replaceable></arg></arg>
      <arg>-e<arg choice="req"><replaceable>err_handler</replaceable></arg></arg>
      <arg>-f<arg choice="req"><replaceable>fencing_policy</replaceable></arg></arg>
      <arg>-b</arg>

    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">net</arg>
      <arg choice="req"><replaceable>local_addr</replaceable></arg>
      <arg><replaceable>:port</replaceable></arg>
      <arg choice="req"><replaceable>remote_addr</replaceable></arg>
      <arg><replaceable>:port</replaceable></arg>
      <arg choice="req"><replaceable>protocol</replaceable></arg>
      <arg>-c<arg choice="req"><replaceable>time</replaceable></arg></arg>
      <arg>-i<arg choice="req"><replaceable>time</replaceable></arg></arg>
      <arg>-t<arg choice="req"><replaceable>val</replaceable></arg></arg>
      <arg>-S<arg choice="req"><replaceable>size</replaceable></arg></arg>
      <arg>-k<arg choice="req"><replaceable>count</replaceable></arg></arg>
      <arg>-e<arg choice="req"><replaceable>max_epoch_size</replaceable></arg></arg>
      <arg>-b<arg choice="req"><replaceable>max_buffers</replaceable></arg></arg>
      <arg>-m</arg>
      <arg>-a<arg choice="req"><replaceable>hash_alg</replaceable></arg></arg>
      <arg>-x<arg choice="req"><replaceable>shared_secret</replaceable></arg></arg>
      <arg>-A<arg choice="req"><replaceable>asb-0p-policy</replaceable></arg></arg>
      <arg>-B<arg choice="req"><replaceable>asb-1p-policy</replaceable></arg></arg>
      <arg>-C<arg choice="req"><replaceable>asb-2p-policy</replaceable></arg></arg>
      <arg>-D</arg>
      <arg>-R<arg choice="req"><replaceable>role-resync-conflict-policy</replaceable></arg></arg>
      <arg>-p<arg choice="req"><replaceable>ping_timeout</replaceable></arg></arg>
      <arg>-u<arg choice="req"><replaceable>val</replaceable></arg></arg>


    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">syncer</arg>
      <arg>-a<arg choice="req"><replaceable>dev_minor</replaceable></arg></arg>
      <arg>-r<arg choice="req"><replaceable>rate</replaceable></arg></arg>
      <arg>-e<arg choice="req"><replaceable>extents</replaceable></arg></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">disconnect</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">detach</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">down</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">primary</arg>
      <arg>-o</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">secondary</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">invalidate</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">invalidate-remote</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">wait-connect</arg>
      <arg>-t<arg choice="req"><replaceable>wfc_timeout</replaceable></arg></arg>
      <arg>-d<arg choice="req"><replaceable>degr_wfc_timeout</replaceable></arg></arg>
      <arg>-w</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">wait-sync</arg>
      <arg>-t<arg choice="req"><replaceable>wfc_timeout</replaceable></arg></arg>
      <arg>-d<arg choice="req"><replaceable>degr_wfc_timeout</replaceable></arg></arg>
      <arg>-w</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">state</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">cstate</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">dstate</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">resize</arg>
      <arg>-d<arg choice="req"><replaceable>size</replaceable></arg></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">pause-sync</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">resume-sync</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">outdate</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">show-gi</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">get-gi</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">show</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">suspend-io</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">resume-io</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>drbdsetup</command>
      <arg choice="req"><replaceable>device</replaceable></arg>
      <arg choice="req">events</arg>
      <arg>-u</arg>
      <arg>-a</arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>
    <para>
      drbdsetup is used to associate DRBD devices with their backing
      block devices, to set up DRBD device pairs to mirror their
      backing block devices, and to inspect the configuration of
      running DRBD devices.
    </para>
  </refsect1>

  <refsect1>
    <title>Note</title>
    <para>
      drbdsetup is a low level tool of the DRBD program suite. It is
      used by the data disk and drbd scripts to communicate with
      the device driver.
    </para>
  </refsect1>

  <refsect1>
    <title>Commands</title>
    <para>
      Each drbdsetup sub-command might require arguments and bring its own
      set of options. All values have default units which might be overruled
      by K, M or G. These units are defined in the usual way (e.g. K = 2^10 = 1024).
    </para>

    <refsect2>
      <title>Common options</title>
      <para>
        All drbdsetup sub-commands accept these two options

	<variablelist>
	  <varlistentry>
	    <term><option>--create-device</option></term>
	    <listitem>
	      <para>
		In case the specified DRBD device (minor number) does not
		exist yet, create it implicitly.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term><option>--set-defaults</option></term>
	    <listitem>
	      <para>
		When <option>--set-defaults</option> is given on the
		command line, all options of the invoked sub-command that
		are not explicitly set are reset to their default values.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>

      </para>
    </refsect2>

    <refsect2>
      <title>disk</title>
      <indexterm><primary>drbdsetup</primary><secondary>disk</secondary></indexterm>
      <para>
	Associates <replaceable>device</replaceable> with
	<replaceable>lower_device</replaceable> to store its data blocks on.
	The <option>-d</option> (or <option>--disk-size</option>) should
	only be used if you wish not to use as much as possible from the
	backing block devices.
	If you do not use <option>-d</option>, the <replaceable>device</replaceable>
	is only ready for use as soon as it was connected to its peer once.
	(See the <option>net</option> command.)
      </para>

      <variablelist>
	<varlistentry>
	  <term><option>-d</option>,
	  <option>--disk-size <replaceable>size</replaceable></option></term>
	  <listitem>
	    <para>
	      You can override DRBD's size determination method with this
	      option. If you need to use the device before it was ever
	      connected to its peer, use this option to pass the
	      <replaceable>size</replaceable> of the DRBD device to the
	      driver. Default unit is sectors (1s = 512 bytes).
	    </para>
	    <para>
	      If you use the <replaceable>size</replaceable> parameter in drbd.conf,
	      we strongly recommend to add an explicit unit postfix.
	      drbdadm and drbdsetup used to have mismatching default units.
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-e</option>,
	  <option>--on-io-error <replaceable>err_handler</replaceable></option></term>
	  <listitem>
	    <para>
	      If the driver of the <replaceable>lower_device</replaceable>
	      reports an error to DRBD, DRBD will either pass the error
	      to the upper layers of the operating system, call a helper
	      program, or detach the device from its backing storage and
	      perform all further IO by requesting it from the peer. The
	      valid <replaceable>err_handlers</replaceable> are:
	      <option>pass_on</option>, <option>call-local-io-error</option>
	      and <option>detach</option>.
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-f</option>,
	  <option>--fencing <replaceable>fencing_policy</replaceable></option></term>
	  <listitem>
	    <para>
	      Under <option>fencing</option> we understand preventative
	      measures to avoid situations where both nodes are primary
	      and disconnected (AKA split brain).
	    </para>
	    <para>
	      Valid fencing policies are:
	    </para>

            <variablelist>
              <varlistentry><term><option>dont-care</option></term>
	        <listitem><para>
		  This is the default policy. No fencing actions are undertaken.
		</para></listitem></varlistentry>
	        <varlistentry><term><option>resource-only</option></term>
		<listitem><para>
		  If a node becomes a disconnected primary. it tries to outdate
		  the peer's disk. This is done by calling the outdate-peer
		  handler. The handler is supposed to reach the other node over
		  alternative communication paths and call 'drbdadm outdate
		  res' there.
		</para></listitem></varlistentry>
		<varlistentry><term><option>resource-and-stonith</option></term>
		<listitem><para>
		  If a node becomes a disconnected primary, it freezes all
		  its IO operations and calls its outdate-peer handler. The
		  outdate-peer handler is supposed to reach the peer over
		  alternative communication paths and call 'drbdadm outdate
		  res' there. In case it cannot reach the peer, it should
		  stonith the peer. IO is resumed as soon as the situation
		  is resolved. In case your handler fails, you can resume
		  IO with the <option>resume-io</option> command.
		</para></listitem></varlistentry>
              </variablelist>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-b</option>,
	  <option>--use-bmbv</option></term>
	  <listitem>
	    <para>
	      In case the backing storage's driver has a merge_bvec_fn()
	      function,  DRBD has to
	      pretend that it can only process IO requests in units
	      not lager than 4kByte. (At time of writing the only known 
	      drivers which
	      have such a function are: md (software raid driver),
	      dm (device mapper - LVM) and DRBD itself)</para>
	    <para>
	      To get best performance out of DRBD on top of software
	      raid (or any other driver with a merge_bvec_fn() function)
	      you might enable this function, if you know for sure
	      that the merge_bvec_fn() function will deliver the same
	      results on all nodes of your cluster. I.e. the physical
	      disks of the software raid are exactly of the same type.
              USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-i</option>,
	  <option>--no-disk-flushes</option></term>
	  <listitem>
	    <para>
      In case you are sure that your storage subsystem has
      battery-backed write cache, and you know from measurements that it
      really honors flush instructions by flushing data out from its
      non-volatile write cache to disk, you have double security. You might then
      reduce this to single security by disabling forced disk flushes with this
      option. It might improve performance in this case.</para>
	    <para>
      If you use this option on plain disk drives, which have
      volatile write caches (enabled by default), you are at risk to lose
      your data with every power loss. <emphasis>Only use this option of you
      understand each and every statement in these two
      paragraphs.</emphasis>
      </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-m</option>,
	  <option>--no-md-flushes</option></term>
	  <listitem>
	        <para>
		  Disables the use of disk flushes and barrier BIOs when
		  accessing the meta data device. See the notes
		  on <option>--no-disk-flushes</option>.
		</para>
	  </listitem>
	</varlistentry>

      </variablelist>
    </refsect2>
    <refsect2>
      <title>net</title>
      <indexterm><primary>drbdsetup</primary><secondary>net</secondary></indexterm>
      <para>
	Sets up the <replaceable>device</replaceable> to listen on
	<replaceable>local_addr:port</replaceable> for incoming connections
	and to try to connect to <replaceable>remote_addr:port</replaceable>.
	If <replaceable>port</replaceable> is omitted, 7788 is used as default.
      </para>
      <para>
	On the TCP/IP link the specified <replaceable>protocol</replaceable>
	is used. Valid protocol specifiers are A, B, and C.</para>
	<para>Protocol A: write IO is reported as completed, if it has reached
	local disk and local TCP send buffer.</para>
	<para>Protocol B: write IO is reported as completed, if it has reached
	local disk and remote buffer cache.</para>
	<para>Protocol C: write IO is reported as completed, if it has
	reached both local and remote disk.</para>
	<variablelist>
	  <varlistentry>
	    <term><option>-c</option>,
	    <option>--connect-int <replaceable>time</replaceable></option></term>
	    <listitem>
	      <para>
		In case it is not possible to connect to the remote DRBD
		device immediately, DRBD keeps on trying to connect. With
		this option you can set the time between two tries. The
		default value is 10 seconds, the unit is 1 second.
		</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><option>-i</option>,
	    <option>--ping-int <replaceable>time</replaceable></option></term>
	    <listitem>
	      <para>
	      If the TCP/IP connection linking a DRBD device pair is idle
	      for more than <replaceable>time</replaceable> seconds, DRBD
	      will generate a keep-alive packet to check if its partner is
	      still alive. The default value is 10 seconds, the unit is 1 second.
	      </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-t</option>,
	  <option>--timeout <replaceable>val</replaceable></option></term>
	  <listitem>
	    <para>
	      If the partner node fails to send an expected response packet
	      within <replaceable>val</replaceable>
	      10<superscript>ths</superscript> of a second, the partner node
	      is considered dead and therefore the TCP/IP connection is
	      abandoned. The default value is 60 (= 6 seconds).
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-S</option>,
	  <option>--sndbuf-size <replaceable>size</replaceable></option></term>
	  <listitem>
	    <para>
	      The socket send buffer is used to store packets sent to the
	      secondary node, which are not yet acknowledged (from a network
	      point of view) by the secondary node. When using protocol A,
	      it might be necessary to increase the size of this data
	      structure in order to increase asynchronicity between primary
	      and secondary nodes. But keep in mind that more asynchronicity
	      is synonymous with more data loss in the case of a primary
	      node failure. Since 8.0.13 setting the <replaceable>size</replaceable>
              value to 0 means that the kernel should autotune this.
              The default <replaceable>size</replaceable> is
	      128 KB, the default unit is KB.
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-k</option>,
	  <option>--ko-count <replaceable>count</replaceable></option></term>
	  <listitem>
	    <para>
	      In case the secondary node fails to complete a single write
	      request for <replaceable>count</replaceable> times the
	      <replaceable>timeout</replaceable>, it is expelled from the
	      cluster. (I.e. the primary node goes into StandAlone mode.)
	      The default is 0, which disables this feature.
	      </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-e</option>, <option>--max-epoch-size
	  <replaceable>val</replaceable></option></term>
	  <listitem>
	    <para>
	      With this option the maximal number of write requests between
	      two barriers is limited. Should be set to the same as
	      <option>--max-buffers </option>. Values smaller than 100 can
	      lead to degraded performance. The default value is 2048.
	      </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-b</option>,
	  <option>--max-buffers <replaceable>val</replaceable></option></term>
	  <listitem>
	    <para>
	      With this option the maximal number of buffer pages allocated
	      by DRBD's receiver thread is limited. Should be set to the
	      same as <option>--max-epoch-size </option>. Small values
	      could lead to degraded performance. (Minimum 32) The default value is
	      2048.
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-u</option>,
	  <option>--unplug-watermark <replaceable>val</replaceable></option></term>
	  <listitem>
	    <para>
	      When the number of pending write requests on the standby
	      (secondary) node exceeds the unplug-watermark, we trigger
	      the request processing of our backing storage device.
	      Some storage controllers deliver better performance with small
	      values, others deliver best performance when the value is set to
	      the same value as max-buffers. Minimum 16, default 128, maximum
	      131072.
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-m</option>,
	  <option>--allow-two-primaries </option></term>
	  <listitem>
	    <para>
	      With this option set you may assign primary role to both nodes. You
	      only should use this option if you use a shared storage
	      file system on top of DRBD. At the time of writing the only
	      ones are: OCFS2 and GFS. If you use this option with any
	      other file system, you are going to crash your nodes and to
	      corrupt your data!
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-a</option>,
	  <option>--cram-hmac-alg </option><replaceable>alg</replaceable></term>
	  <listitem>
	    <para>
	      You need to specify the HMAC algorithm to enable peer
	      authentication at all. You are strongly encouraged to use
	      peer authentication.
	      The HMAC algorithm will be used for the challenge
	      response authentication of the peer. You may specify any
	      digest algorithm that is named in /proc/crypto.
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-x</option>,
	  <option>--shared-secret </option><replaceable>secret</replaceable></term>
	  <listitem>
	    <para>
	      The shared secret used in peer authentication. May be up to
	      64 characters.
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-A</option>,
	  <option>--after-sb-0pri </option><replaceable>asb-0p-policy</replaceable></term>
	  <listitem>
	    <para>
	    possible policies are:
	    </para>
            <variablelist>
              <varlistentry><term><option>disconnect</option></term>
	        <listitem><para>
		  No automatic resynchronization, simply disconnect.
		</para></listitem></varlistentry>
	        <varlistentry><term><option>discard-younger-primary</option></term>
		<listitem><para>
		  Auto sync from the node that was primary before the split-brain situation occurred.
		</para></listitem></varlistentry>
		<varlistentry><term><option>discard-older-primary</option></term>
		<listitem><para>
		Auto sync from the node that became primary as second during
		the split-brain situation.
		</para></listitem></varlistentry>
		<varlistentry><term><option>discard-zero-changes</option></term>
		<listitem><para>
		In case one node did not write anything since the split
		brain became evident, sync from the node that wrote something
		to the node that did not write anything. In case none wrote
		anything this policy uses a random decision to perform
		a "resync" of 0 blocks. In case both have written something
		this policy disconnects the nodes.
		</para></listitem></varlistentry>

		<varlistentry><term><option>discard-least-changes</option></term>
		<listitem><para>
		Auto sync from the node that touched more blocks during the
		split brain situation.
		</para></listitem></varlistentry>
		<varlistentry><term><option>discard-node-NODENAME</option></term>
		<listitem><para>
		Auto sync to the named node.
		</para></listitem></varlistentry>
              </variablelist>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-B</option>,
	  <option>--after-sb-1pri </option><replaceable>asb-1p-policy</replaceable></term>
	  <listitem>
	    <para>
	    possible policies are:
	    </para>
            <variablelist>
              <varlistentry><term><option>disconnect</option></term>
	        <listitem><para>
		  No automatic resynchronization, simply disconnect.
		</para></listitem></varlistentry>
	        <varlistentry><term><option>consensus</option></term>
		<listitem><para>
		  Discard the version of the secondary if the outcome
                  of the <option>after-sb-0pri</option> algorithm would also
		  destroy the current secondary's data. Otherwise disconnect.
		</para></listitem></varlistentry>
		<varlistentry><term><option>discard-secondary</option></term>
		<listitem><para>
		  Discard the secondary's version.
		</para></listitem></varlistentry>
		<varlistentry><term><option>call-pri-lost-after-sb</option></term>
		<listitem><para>
		  Always honor the outcome of the <option>after-sb-0pri
		  </option> algorithm. In case it decides the current
		  secondary has the right data, call the
		  <option>pri-lost-after-sb</option> on the current primary.
		</para></listitem></varlistentry>
		<varlistentry><term><option>violently-as0p</option></term>
		<listitem><para>
		  Always honor the outcome of the <option>after-sb-0pri
		  </option> algorithm. In case it decides the current
		  secondary has the right data, accept a possible instantaneous
		  change of the primary's data.
		</para></listitem></varlistentry>
              </variablelist>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-C</option>,
	  <option>--after-sb-2pri </option><replaceable>asb-2p-policy</replaceable></term>
	  <listitem>
	    <para>
	    possible policies are:
	    </para>
            <variablelist>
              <varlistentry><term><option>disconnect</option></term>
	        <listitem><para>
		  No automatic resynchronization, simply disconnect.
		</para></listitem></varlistentry>
		<varlistentry><term><option>call-pri-lost-after-sb</option></term>
		<listitem><para>
		  Always honor the outcome of the <option>after-sb-0pri
		  </option> algorithm. In case it decides the current
		  secondary has the right data, call the
		  <option>pri-lost-after-sb</option> on the current primary.
		</para></listitem></varlistentry>
		<varlistentry><term><option>violently-as0p</option></term>
		<listitem><para>
		  Always honor the outcome of the <option>after-sb-0pri
		  </option> algorithm. In case it decides the current
		  secondary has the right data, accept a possible instantaneous
		  change of the primary's data.
		</para></listitem></varlistentry>
              </variablelist>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-P</option>,
	  <option>--always-asbp</option></term>
	  <listitem>
	    <para>
	      Normally the automatic after-split-brain policies are only 
	      used if current states of the UUIDs do not indicate the 
	      presence of a third node.
	    </para>
	    <para>
	      With this option you request that the automatic 
	      after-split-brain policies are used as long as the data
	      sets of the nodes are somehow related. This might cause
	      a full sync, if the UUIDs indicate the presence of a third
	      node. (Or double faults have led to strange UUID sets.)
	    </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-R</option>,
	  <option>--rr-conflict </option><replaceable>role-resync-conflict-policy</replaceable></term>
	  <listitem>
	    <para>
	      This option sets DRBD's behavior when DRBD deduces from its
	      meta data that a resynchronization is needed, and the SyncTarget
	      node is already primary. The possible settings are:
	      <option>disconnect</option>,
	      <option>call-pri-lost</option> and
	      <option>violently</option>. While <option>disconnect</option>
	      speaks for itself, with the <option>call-pri-lost</option>
	      setting the <option>pri-lost</option> handler is called
	      which is expected to either change the role of the node to
	      secondary, or remove the node from the cluster.
	      The default is <option>disconnect</option>.</para>
	    <para>
	      With the <option>violently</option> setting you allow DRBD
	      to force a primary node into SyncTarget state. This means
	      that with that action the data exposed by DRBD change to
	      the SyncSource's version of the data instantaneously.
	      USE THIS OPTION ONLY IF YOU KNOW WHAT YOU ARE DOING.
	    </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-p</option>,
	  <option>--ping-timeout </option><replaceable>ping_timeout</replaceable></term>
	  <listitem>
	    <para>
	      The time the peer has to answer to a keep-alive packet. In case the peer's reply is not received within this
	      time period, it is considered as dead. The default value is 500ms,
	      the default unit is 100ms.
	    </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><option>-D</option>,
	  <option>--discard-my-data </option></term>
	  <listitem>
	    <para>
	      Use this option to manually recover from a split-brain
	      situation. In case you do not have any automatic after-split-brain policies selected, the nodes refuse to
	      connect. By passing this option you make a node to
	      sync target immediately after successful connect.
	    </para>
	  </listitem>
	</varlistentry>

      </variablelist>
    </refsect2>
    <refsect2>
      <title>syncer</title>
      <indexterm><primary>drbdsetup</primary><secondary>syncer</secondary></indexterm>
      <para>
	Changes the synchronization daemon parameters of
	<replaceable>device</replaceable> at runtime.
      </para>
      <variablelist>
	<varlistentry>
	  <term><option>-r</option>,
	  <option>--rate <replaceable>rate</replaceable></option></term>
	  <listitem>
	    <para>
	      To ensure smooth operation of the application on top of DRBD,
	      it is possible to limit the bandwidth that  may be used by
	      background synchronization. The default is 250 KB/sec, the
	      default unit is KB/sec.
	    </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-a</option>,
	  <option>--after <replaceable>minor</replaceable></option></term>
	  <listitem>
	    <para>
	      Start resync on this device only if the device with
	      <replaceable>minor</replaceable> is already in connected
	      state. Otherwise this device waits in SyncPause state.
	  </para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><option>-e</option>,
	  <option>--al-extents <replaceable>extents</replaceable></option></term>
	  <listitem>
	    <para>
	      DRBD automatically performs hot area detection. With this
	      parameter you control how big the hot area (=active set) can
	      get. Each extent marks 4M of the backing storage. In case a
	      primary node leaves the cluster unexpectedly, the areas covered
	      by the active set must be resynced upon rejoining of the failed
	      node. The data structure is stored in the meta-data area,
	      therefore each change of the active set is a write operation
	      to the meta-data device. A higher number of extents gives
	      longer resync times but less updates to the meta-data. The
	      default number of <replaceable>extents</replaceable> is
	      127. (Minimum: 7, Maximum: 3843)
	    </para>
	  </listitem>
	</varlistentry>
      </variablelist>
    </refsect2>
    <refsect2>
      <title>primary</title>
      <indexterm><primary>drbdsetup</primary><secondary>primary</secondary></indexterm>
      <para>
	Sets the <replaceable>device</replaceable> into primary role. This
	means that applications (e.g. a file system) may open the
	<replaceable>device</replaceable> for read and write access. Data
	written to the <replaceable>device</replaceable> in primary role are
	mirrored to the device in secondary role.
      </para>
      <para>
	Normally it is not possible to set both devices of a connected DRBD device
	pair to primary role. By using the <option>--allow-two-primaries</option>
	option, you override this behavior and instruct DRBD to allow two
	primaries.
      </para>
      <variablelist>
	<varlistentry>
	  <term><option>-o</option>,
	  <option>--overwrite-data-of-peer</option></term>
	  <listitem>
	    <para>
	      Becoming primary fails if the local replica is
	      inconsistent. By using this option you can force it into
	      primary state anyway. USE THIS OPTION ONLY IF YOU KNOW WHAT
	      YOU ARE DOING.
	    </para>
	  </listitem>
	</varlistentry>
      </variablelist>
    </refsect2>
    <refsect2>
      <title>secondary</title>
      <indexterm><primary>drbdsetup</primary><secondary>secondary</secondary></indexterm>
      <para>
	Sets the <replaceable>device</replaceable> into secondary state.
	This operation fails as long as at least one application (or file
	system) has the device open for write access.
      </para>
      <para>
	It is however, possible that both devices of a connected DRBD device
	pair are in secondary state.
      </para>
    </refsect2>
    <refsect2>
      <title>invalidate</title>
      <indexterm><primary>drbdsetup</primary><secondary>invalidate</secondary></indexterm>
      <para>
	This forces the local device of a pair of connected DRBD devices
	into SyncTarget state, which means that all data blocks of the
	device are copied over from the peer.
      </para>
      <para>
	This command will fail if the <replaceable>device</replaceable> is
	not part of a connected device pair.
      </para>
    </refsect2>
    <refsect2>
      <title>invalidate-remote</title>
      <indexterm><primary>drbdsetup</primary><secondary>invalidate-remote</secondary></indexterm>
      <para>
	This forces the local device of a pair of connected DRBD devices
	into SyncSource state, which means that all data blocks of the
	device are copied to the peer.
      </para>
    </refsect2>
    <refsect2>
      <title>wait-connect</title>
      <indexterm><primary>drbdsetup</primary><secondary>wait-connect</secondary></indexterm>
      <para>
	Returns as soon as the <replaceable>device</replaceable> can
	communicate with its partner device.
      </para>
      <variablelist>
	<varlistentry>
	  <term><option>-t</option>,
	  <option>--wfc-timeout <replaceable>wfc_timeout</replaceable></option></term>
	  <term><option>-d</option>,
	  <option>--degr-wfc-timeout <replaceable>degr_wfc_timeout</replaceable></option></term>
	  <term><option>-w</option>, <option>--wait-after-sb</option></term>
	  <listitem>
	    <para>
	      This command will fail if the
	      <replaceable>device</replaceable> cannot communicate with its
	      partner for <replaceable>timeout</replaceable>
	      seconds. If the peer was working before this node was
	      rebooted, the wfc_timeout is used. If the peer was already
	      down before this node was rebooted, the degr_wfc_timeout
	      is used.
	      The default value for <replaceable>wfc_timeout</replaceable>
	      is 0 which means to wait forever. The default for
	      <replaceable>degr_wfc_timeout</replaceable> is 120 seconds.
	      In case the connection status goes down to StandAlone because
              the peer appeared but the devices had a split brain situation,
              the default for the command is to terminate. You can change this
              behavior with the <option>--wait-after-sb</option> option.
	    </para>
	  </listitem>
	</varlistentry>
      </variablelist>
    </refsect2>
    <refsect2>
      <title>wait-sync</title>
      <indexterm><primary>drbdsetup</primary><secondary>wait-sync</secondary></indexterm>
      <para>
	Returns as soon as the <replaceable>device</replaceable> leaves any
	synchronization into connected state. The options
	are the same as with the <replaceable>wait-connect</replaceable>
	command.
      </para>
    </refsect2>
    <refsect2>
      <title>disconnect</title>
      <indexterm><primary>drbdsetup</primary><secondary>disconnect</secondary></indexterm>
      <para>
	Removes the information set by the <option>net</option> command
	from the <replaceable>device</replaceable>. This means
	that the <replaceable>device</replaceable> goes into unconnected
	state and will no longer listen for incoming connections.
      </para>
    </refsect2>
    <refsect2>
      <title>detach</title>
      <indexterm><primary>drbdsetup</primary><secondary>detach</secondary></indexterm>
      <para>
	Removes the information set by the <option>disk</option> command
	from the <replaceable>device</replaceable>. This means
	that the <replaceable>device</replaceable> is detached from its
	backing storage device.
      </para>
    </refsect2>
    <refsect2>
      <title>down</title>
      <indexterm><primary>drbdsetup</primary><secondary>down</secondary></indexterm>
      <para>
	Removes all configuration information from the
	<replaceable>device</replaceable> and forces it back to
	unconfigured state.
      </para>
    </refsect2>
    <refsect2>
      <title>state</title>
      <indexterm><primary>drbdsetup</primary><secondary>state</secondary></indexterm>
      <para>
	Shows the current states of the <replaceable>device</replaceable> and
	its peer. (local/peer).
      </para>
    </refsect2>
    <refsect2>
      <title>cstate</title>
      <indexterm><primary>drbdsetup</primary><secondary>cstate</secondary></indexterm>
      <para>
	Shows the current connection state of the
	<replaceable>device</replaceable>.
      </para>
    </refsect2>
    <refsect2>
      <title>dstate</title>
      <indexterm><primary>drbdsetup</primary><secondary>dstate</secondary></indexterm>
      <para>
	Shows the current states of the backing storage devices. (local/peer)
      </para>
    </refsect2>
    <refsect2>
      <title>resize</title>
      <indexterm><primary>drbdsetup</primary><secondary>resize</secondary></indexterm>
      <para>
	This causes DRBD to reexamine the size of the
	<replaceable>device</replaceable>'s backing storage device.  To
	actually do online growing you need to extend the backing storages
	on both devices and call the <option>resize</option> command one of
        your nodes.
      </para>
    </refsect2>
    <refsect2>
      <title>pause-sync</title>
      <indexterm><primary>drbdsetup</primary><secondary>pause-sync</secondary></indexterm>
      <para>
        Temporarily suspend an ongoing resynchronization by setting the local
	pause flag. Resync only progresses if neither the local nor the
	remote pause flag is set. It might be desirable to postpone DRBD's
	resynchronization after eventual resynchronization of the backing
	storage's RAID setup.
      </para>
    </refsect2>
    <refsect2>
      <title>resume-sync</title>
      <indexterm><primary>drbdsetup</primary><secondary>resume-sync</secondary></indexterm>
      <para>
        Unset the local sync pause flag.
      </para>
    </refsect2>
    <refsect2>
      <title>outdate</title>
      <indexterm><primary>drbdsetup</primary><secondary>outdate</secondary></indexterm>
      <para>
        Mark the data on the local backing storage as outdated. An outdated
	device refuses to become primary. This is used in conjunction with
	<option>fencing</option> and by the peer's outdate-peer handler.
      </para>
    </refsect2>
    <refsect2>
      <title>show-gi</title>
      <indexterm><primary>drbdsetup</primary><secondary>show-gi</secondary></indexterm>
      <para>
        Displays the device's data generation identifiers verbosely.
      </para>
    </refsect2>
    <refsect2>
      <title>get-gi</title>
      <indexterm><primary>drbdsetup</primary><secondary>get-gi</secondary></indexterm>
      <para>
        Displays the device's data generation identifiers.
      </para>
    </refsect2>
    <refsect2>
      <title>show</title>
      <indexterm><primary>drbdsetup</primary><secondary>show</secondary></indexterm>
      <para>
	Shows all available configuration information of the
	<replaceable>device</replaceable>.
      </para>
    </refsect2>
    <refsect2>
      <title>suspend-io</title>
      <indexterm><primary>drbdsetup</primary><secondary>suspend-io</secondary></indexterm>
      <para>
	This command is of no apparent use and just provided for the sake
	of completeness.
      </para>
    </refsect2>
    <refsect2>
      <title>resume-io</title>
      <indexterm><primary>drbdsetup</primary><secondary>resume-io</secondary></indexterm>
      <para>
	If the outdate-peer handler fails to stonith the peer node,
	and your <option>fencing</option> policy is set to
	resource-and-stonith, you can unfreeze IO operations with this
	command.
      </para>
    </refsect2>

    <refsect2>
      <title>events</title>
      <indexterm><primary>drbdsetup</primary><secondary>events</secondary></indexterm>
      <para>
      	Displays every state change of DRBD and all calls to helper
	programs. This might be used to get notified of DRBD's state
	changes by piping the output to another program.

	<variablelist>
	  <varlistentry>
	    <term><option>-a</option>,
	    <option>--all-devices</option></term>
	    <listitem>
	      <para>
		Display the events of all DRBD minors.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term><option>-u</option>,
	    <option>--unfiltered</option></term>
	    <listitem>
	      <para>
		This is a debugging aid that displays the content of
		all received netlink messages.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </para>
    </refsect2>

  </refsect1>
  <refsect1>
    <title>Examples</title>
      <para>
      For examples, please have a look at the
      <ulink url="http://www.drbd.org/users-guide/">
      <citetitle>DRBD User's Guide</citetitle></ulink>.
      </para>
  </refsect1>

  <refsect1>
    <title>Version</title>
<simpara>This document was revised for version 8.0.14 of the DRBD distribution.
</simpara>
  </refsect1>

  <refsect1>
    <title>Author</title>
    <simpara>Written by Philipp Reisner <email>philipp.reisner@linbit.com</email>
            and Lars Ellenberg <email>lars.ellenberg@linbit.com</email>
    </simpara>
  </refsect1>
  <refsect1>
    <title>Reporting Bugs</title>
    <simpara>Report bugs to <email>drbd-user@lists.linbit.com</email>.
    </simpara>
  </refsect1>
  <refsect1>
    <title>Copyright</title>
    <simpara>
Copyright 2001-2008 LINBIT Information Technologies,
Philipp Reisner, Lars Ellenberg. This  is  free software;
see the source for copying conditions.  There is NO warranty;
not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    </simpara>
  </refsect1>
  <refsect1>
    <title>See Also</title>
    <para>
      <citerefentry><refentrytitle>drbd.conf</refentrytitle>
      <manvolnum>5</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>drbd</refentrytitle>
      <manvolnum>8</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>drbddisk</refentrytitle>
      <manvolnum>8</manvolnum></citerefentry>
      <citerefentry><refentrytitle>drbdadm</refentrytitle>
      <manvolnum>8</manvolnum></citerefentry>
      <ulink url="http://www.drbd.org/users-guide/">
      <citetitle>DRBD User's Guide</citetitle></ulink>,
      <ulink url="http://www.drbd.org/">
      <citetitle>DRBD web site</citetitle></ulink>
    </para>
  </refsect1>
</refentry>
