title: deb822(5)

summary: Debian RFC822 control data format

text:
# deb822(5)

## NAME
deb822 - Debian RFC822 control data format

## DESCRIPTION
The package management system manipulates data represented in a common format, known as control data, stored in control files. Control files are used for source packages, binary packages and the .changes files which control the installation of uploaded files (dpkg's internal databases are in a similar format).

## SYNTAX
A control file consists of one or more stanzas of fields (the stanzas sometimes used to be referred to as paragraphs). The stanzas are separated by empty lines. Parsers may accept lines consisting solely of U+0020 SPACE and U+0009 TAB as stanza separators, but control files should use empty lines. Some control files allow only one stanza; others allow several, in which case each stanza usually refers to a different package. (For example, in source packages, the first stanza refers to the source package, and later stanzas refer to binary packages generated from the source.) The ordering of the stanzas in control files is significant.

Each stanza consists of a series of data fields. Each field consists of the field name followed by a colon (U+003A ‘:’), and then the data/value associated with that field. The field name is composed of US-ASCII characters excluding control characters, space, and colon (i.e., characters in the ranges U+0021 ‘!’ through U+0039 ‘9’, and U+003B ‘;’ through U+007E ‘~’, inclusive). Field names must not begin with the comment character (U+0023 ‘#’), nor with the hyphen character (U+002D ‘-’).

The field ends at the end of the line or at the end of the last continuation line (see below). Horizontal whitespace (U+0020 SPACE and U+0009 TAB) may occur immediately before or after the value and is ignored there; it is conventional to put a single space after the colon. For example, a field might be:

```
 Package: dpkg
```

the field name is Package and the field value dpkg.

Empty field values are only permitted in source package control files (debian/control). Such fields are ignored.

A stanza must not contain more than one instance of a particular field name.

There are three types of fields:

simple

The field, including its value, must be a single line. Folding of the field is not permitted. This is the default field type if the definition of the field does not specify a different type.

folded

The value of a folded field is a logical line that may span several lines. The lines after the first are called continuation lines and must start with a U+0020 SPACE or a U+0009 TAB. Whitespace, including any newlines, is not significant in the field values of folded fields. This folding method is similar to RFC5322, allowing control files that contain only one stanza and no multiline fields to be read by parsers written for RFC5322.

multiline

The value of a multiline field may comprise multiple continuation lines. The first line of the value, the part on the same line as the field name, often has special significance or may have to be empty. Other lines are added following the same syntax as the continuation lines of the folded fields. Whitespace, including newlines, is significant in the values of multiline fields.

Whitespace must not appear inside names (of packages, architectures, files or anything else) or version numbers, or between the characters of multi-character version relationships.

The presence and purpose of a field, and the syntax of its value may differ between types of control files.

Field names are not case-sensitive, but it is usual to capitalize the field names using mixed case as shown below. Field values are case-sensitive unless the description of the field says otherwise.

Stanza separators (empty lines) and lines consisting only of U+0020 SPACE and U+0009 TAB, are not allowed within field values or between fields. Empty lines in field values are usually escaped by representing them by a U+0020 SPACE followed by a dot (U+002E ‘.’).

Lines starting with U+0023 ‘#’, without any preceding whitespace are comments lines that are only permitted in source package control files (debian/control) and in deb-origin(5) files. These comment lines are ignored, even between two continuation lines. They do not end logical lines.

All control files must be encoded in UTF-8.

## SEE ALSO
RFC822, RFC5322.


dpkg.cfg

package: dpkg

title: dpkg.cfg(5)

summary: dpkg configuration file

text:
# dpkg.cfg(5)

## NAME
dpkg.cfg - dpkg configuration file

## DESCRIPTION
This file contains default options for dpkg. Each line contains a single option which is exactly the same as a normal command line option for dpkg except for the leading hyphens which are not used here. Quotes surrounding option values are stripped. Comments are allowed by starting a line with a hash sign (‘#’).

## FILES
/etc/dpkg/dpkg.cfg.d/[0-9a-zA-Z_-]*

/etc/dpkg/dpkg.cfg

~/.dpkg.cfg

## SEE ALSO
dpkg(1).


dsc

title: dsc(5)

text:
# dsc(5)

## NAME
dsc - Debian source packages' control file format

## SYNOPSIS
filename.dsc

## DESCRIPTION
Each Debian source package is composed of a .dsc control file, which contains a number of fields, in deb822(5) format.

Each field begins with a tag, such as Source or Binary (case insensitive), followed by a colon, and the body of the field (case sensitive unless stated otherwise). Fields are delimited only by field tags. In other words, field text may be multiple lines in length, but the installation tools will generally join lines when processing the body of the field (except in case of the multiline fields Package-List, Files, Checksums-Sha1 and Checksums-Sha256, see below).

The control data might be enclosed in an OpenPGP ASCII Armored signature, as specified in RFC4880.

## FIELDS
Format: format-version (required)

The value of this field declares the format version of the source package. The field value is used by programs acting on a source package to interpret the list of files in the source package and determine how to unpack it. The syntax of the field value is a numeric major revision (“0-9”), a period (“.”), a numeric minor revision (“0-9”), and then an optional subtype after whitespace (“ \t”), which if specified is a lowercase alphanumeric (“a-z0-9”) word in parentheses (“()”). The subtype is optional in the syntax but may be mandatory for particular source format revisions. The source formats currently supported by dpkg are 1.0, 2.0, 3.0 (native), 3.0 (quilt), 3.0 (git), 3.0 (bzr) and 3.0 (custom). See dpkg-source(1) for their description.

Source: source-name (required)

The value of this field determines the package name, and is used to generate file names by most installation tools.

Binary: binary-package-list

This folded field lists binary packages which this source package can produce, separated by commas. This field has now been superseded by the Package-List field, which gives enough information about what binary packages are produced on which architecture, build-profile and other involved restrictions.

Architecture: arch-list (recommended)

A list of architectures and architecture wildcards separated by spaces which specify the type of hardware this package can be compiled for. Common architecture names and architecture wildcards are amd64, armel, i386, linux-any, any-amd64, etc. Note that the all value is meant for packages that are architecture independent, and any for packages that are architecture dependent. The list may include (or consist solely of) the special value all. When the list contains the architecture wildcard any, the only other value allowed in the list is all.

The field value is generally generated from Architecture fields from in the debian/control in the source package.

Version: version-string (required)

Typically, this is the original package's version number in whatever form the program's author uses. It may also include a Debian revision number (for non-native packages). The exact format and sorting algorithm are described in deb-version(7).

Origin: name

The name of the distribution this package is originating from.

Maintainer: fullname-email (recommended)

Should be in the format “Joe Bloggs <jbloggs@foo.com>”, and is typically the person who created the package, as opposed to the author of the software that was packaged.

Uploaders: fullname-email-list

Lists all the names and email addresses of co-maintainers of the package, in the same format as the Maintainer field. Multiple co-maintainers should be separated by a comma.

Description short-description

long-description

The format for the source package description is a short brief summary on the first line (after the Description field). The following lines should be used as a longer, more detailed description. Each line of the long description must be preceded by a space, and blank lines in the long description must contain a single ‘.’ following the preceding space.

Homepage: url

The upstream project home page url.

Standards-Version: version-string (recommended)

This documents the most recent version of the distribution policy standards this package complies with.

Vcs-Browser: url

The url of a web interface to browse the Version Control System repository.

Vcs-Arch: url

Vcs-Bzr: url

Vcs-Cvs: url

Vcs-Darcs: url

Vcs-Git: url

Vcs-Hg: url

Vcs-Mtn: url

Vcs-Svn: url

These fields declare the url of the Version Control System repository used to maintain this package. See deb-src-control(5) for more details.

Testsuite: name-list

This field declares that the source package contains the specified test suites. The value is a comma-separated list of test suites. If the autopkgtest value is present, a debian/tests/control is expected to be present, if the file is present but not the value, then dpkg-source will automatically add it, preserving previous values.

Testsuite-Triggers: package-list

This field declares the comma-separated union of all test dependencies (Depends fields in debian/tests/control file), with all restrictions removed, and OR dependencies flattened (that is, converted to separate AND relationships), except for binaries generated by this source package and its meta-dependency equivalent @. Rationale: this field is needed because otherwise to be able to get the test dependencies, each source package would need to be unpacked.

Build-Depends: package-list

Build-Depends-Arch: package-list

Build-Depends-Indep: package-list

Build-Conflicts: package-list

Build-Conflicts-Arch: package-list

Build-Conflicts-Indep: package-list

These fields declare relationships between the source package and packages used to build it. They are discussed in the deb-src-control(5) manpage.

Package-List:

package package-type section priority key-value-list

This multiline field contains a list of binary packages generated by this source package. The package is the binary package name.

The package-type is the binary package type, usually deb, another common value is udeb.

The section and priority match the binary package fields of the same name.

The key-value-list is a space separated key=value list, and the currently known optional keys are:

arch

The architecture restriction from the binary package Architecture field, with spaces converted to ‘,’.

profile

The normalized build-profile restriction formula from the binary package Build-Profile field, with ORs converted to ‘+’ and ANDs to ‘,’.

protected

If the binary package is protected, this key will contain the value of the Protected field, that is a yes value. Supported since dpkg 1.20.1.

essential

If the binary package is essential, this key will contain the value of the Essential field, that is a yes value.

Files: (required)

Checksums-Sha1: (required)

Checksums-Sha256: (required)

checksum size filename

These multiline fields contain a list of files with a checksum and size for each one. These fields have the same syntax and differ only in the checksum algorithm used: MD5 for Files, SHA-1 for Checksums-Sha1 and SHA-256 for Checksums-Sha256. The first line of the field value (the part on the same line as the field name followed by a colon) is always empty. The content of the field is expressed as continuation lines, one line per file. Each line consists of the checksum, a space, the file size, a space, and the file name.

These fields list all files that make up the source package. The list of files in these fields must match the list of files in the other related fields.

## BUGS
The Format field conflates the format for the .dsc file itself and the format of the extracted source package.

## SEE ALSO
deb822(5), deb-src-control(5), deb-version(7), dpkg-source(1).


dracut.conf

package: dracut

title: dracut.conf(5)

summary: configuration file(s) for dracut

text:
# dracut.conf(5)

## NAME
dracut.conf - configuration file(s) for dracut

## SYNOPSIS
/etc/dracut.conf /etc/dracut.conf.d/*.conf /usr/lib/dracut/dracut.conf.d/*.conf

## DESCRIPTION
dracut.conf is loaded during the initialisation phase of dracut. Command line parameter will override any values set here.

*.conf files are read from /usr/lib/dracut/dracut.conf.d and /etc/dracut.conf.d. Files with the same name in /etc/dracut.conf.d will replace files in /usr/lib/dracut/dracut.conf.d. The files are then read in alphanumerical order and will override parameters set in /etc/dracut.conf. Each line specifies an attribute and a value. A # indicates the beginning of a comment; following characters, up to the end of the line are not interpreted.

dracut command line options will override any values set here.

Configuration files must have the extension .conf; other extensions are ignored.

add_dracutmodules+=" <dracut modules> "

Add a space-separated list of dracut modules to call when building the initramfs. Modules are located in /usr/lib/dracut/modules.d.

force_add_dracutmodules+=" <dracut modules> "

Force to add a space-separated list of dracut modules to the default set of modules, when host-only mode is specified. This parameter can be specified multiple times.

omit_dracutmodules+=" <dracut modules> "

Omit a space-separated list of dracut modules to call when building the initramfs. Modules are located in /usr/lib/dracut/modules.d.

dracutmodules+=" <dracut modules> "

Specify a space-separated list of dracut modules to call when building the initramfs. Modules are located in /usr/lib/dracut/modules.d. This option forces dracut to only include the specified dracut modules. In most cases the "add_dracutmodules" option is what you want to use.

add_drivers+=" <kernel modules> "

Specify a space-separated list of kernel modules to add to the initramfs. The kernel modules have to be specified without the ".ko" suffix.

force_drivers+=" <list of kernel modules> "

See add_drivers above. But in this case it is ensured that the drivers are tried to be loaded early via modprobe.

omit_drivers+=" <kernel modules> "

Specify a space-separated list of kernel modules not to add to the initramfs. The kernel modules have to be specified without the ".ko" suffix.

drivers+=" <kernel modules> "

Specify a space-separated list of kernel modules to exclusively include in the initramfs. The kernel modules have to be specified without the ".ko" suffix.

filesystems+=" <filesystem names> "

Specify a space-separated list of kernel filesystem modules to exclusively include in the generic initramfs.

drivers_dir="<kernel modules directory>"

Specify the directory where to look for kernel modules.

fw_dir+=" :<dir>[:<dir> ...] "

Specify additional colon-separated list of directories where to look for firmware files.

libdirs+=" <dir>[ <dir> ...] "

Specify a space-separated list of directories where to look for libraries.

install_items+=" <file>[ <file> ...] "

Specify additional files to include in the initramfs, separated by spaces.

install_optional_items+=" <file>[ <file> ...] "

Specify additional files to include in the initramfs, separated by spaces, if they exist.

compress="{cat|bzip2|lzma|xz|gzip|lzop|lz4|zstd|<compressor [args ...]>}"

Compress the generated initramfs using the passed compression program. If you pass it just the name of a compression program, it will call that program with known-working arguments. If you pass arguments, it will be called with exactly those arguments. Depending on what you pass, this may result in an initramfs that the kernel cannot decompress. To disable compression, use "cat".

squash_compress="{<compressor [args ...]>}"

Compress the squashfs image using the passed compressor and compressor specific options for mksquashfs. You can refer to mksquashfs manual for supported compressors and compressor specific options. If squash module is not called when building the initramfs, this option will not take effect.

do_strip="{yes|no}"

Strip binaries in the initramfs (default=yes).

aggressive_strip="{yes|no}"

Strip more than just debug symbol and sections, for a smaller initramfs build. The "do_strip=yes" option must also be specified (default=no).

do_hardlink="{yes|no}"

Hardlink files in the initramfs (default=yes).

prefix=" <directory> "

Prefix initramfs files with <directory>.

hostonly="{yes|no}"

Host-only mode: Install only what is needed for booting the local host instead of a generic host and generate host-specific configuration (default=no).

hostonly_mode="{sloppy|strict}"

Specify the host-only mode to use (default=sloppy). In "sloppy" host-only mode, extra drivers and modules will be installed, so minor hardware change won’t make the image unbootable (e.g. changed keyboard), and the image is still portable among similar hosts. With "strict" mode enabled, anything not necessary for booting the local host in its current state will not be included, and modules may do some extra job to save more space. Minor change of hardware or environment could make the image unbootable.

hostonly_cmdline="{yes|no}"

If set to "yes", store the kernel command line arguments needed in the initramfs. If hostonly="yes" and this option is not configured, it’s automatically set to "yes".

hostonly_nics+=" [<nic>[ <nic> ...]] "

Only enable listed NICs in the initramfs. The list can be empty, so other modules can install only the necessary network drivers.

persistent_policy="<policy>"

Use <policy> to address disks and partitions. <policy> can be any directory name found in /dev/disk (e.g. "by-uuid", "by-label"), or "mapper" to use /dev/mapper device names (default=mapper).

tmpdir="<temporary directory>"

Specify temporary directory to use.

Warning If chrooted to another root other than the real root device, use --fstab and provide a valid /etc/fstab.

use_fstab="{yes|no}"

Use /etc/fstab instead of /proc/self/mountinfo (default=no).

add_fstab+=" <filename> "

Add entries of <filename> to the initramfs /etc/fstab.

add_device+=" <device> "

Bring up <device> in initramfs, <device> should be the device name. This can be useful in host-only mode for resume support when your swap is on LVM an encrypted partition.

mdadmconf="{yes|no}"

Include local /etc/mdadm.conf (default=no).

lvmconf="{yes|no}"

Include local /etc/lvm/lvm.conf (default=no).

fscks=" <fsck tools> "

Add a space-separated list of fsck tools. If nothing is specified, the default is: "umount mount /sbin/fsck* xfs_db xfs_check xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is opportunistic (non-existing tools are ignored).

nofscks="{yes|no}"

If specified, inhibit installation of any fsck tools (default=no).

ro_mnt="{yes|no}"

Mount / and /usr read-only by default (default=no).

kernel_cmdline="parameters"

Specify default kernel command line parameters.

kernel_only="{yes|no}"

Only install kernel drivers and firmware files (default=no).

no_kernel="{yes|no}"

Do not install kernel drivers and firmware files (default=no).

acpi_override="{yes|no}"

[WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! Override BIOS provided ACPI tables. For further documentation read Documentation/acpi/initrd_table_override.txt in the kernel sources. Search for ACPI table files (must have .aml suffix) in acpi_table_dir= directory (see below) and add them to a separate uncompressed cpio archive. This cpio archive gets glued (concatenated, uncompressed one must be the first one) to the compressed cpio archive. The first, uncompressed cpio archive is for data which the kernel must be able to access very early (and cannot make use of uncompress algorithms yet) like microcode or ACPI tables (default=no).

acpi_table_dir="<dir>"

Directory to search for ACPI tables if acpi_override= is set to yes.

early_microcode="{yes|no}"

Combine early microcode with ramdisk (default=yes).

stdloglvl="{0-6}"

Specify logging level for standard error (default=4).

Note Logging levels:

```
    0 - suppress any messages

    1 - only fatal errors

    2 - all errors

    3 - warnings

    4 - info

    5 - debug info (here starts lots of output)

    6 - trace info (and even more)
```

sysloglvl="{0-6}"

Specify logging level for syslog (default=0).

fileloglvl="{0-6}"

Specify logging level for logfile (default=4).

logfile="<file>"

Path to logfile.

sshkey="<file>"

SSH key file used with ssh-client module.

show_modules="{yes|no}"

Print the name of the included modules to standard output during build (default=no).

i18n_vars="<variable mapping>"

Distribution specific variable mapping. See dracut/modules.d/10i18n/README for a detailed description.

i18n_default_font="<fontname>"

The font <fontname> to install, if not specified otherwise. Default is "eurlatgr".

i18n_install_all="{yes|no}"

Install everything regardless of generic or host-only mode (default=no).

reproducible="{yes|no}"

Create reproducible images (default=no).

noimageifnotneeded="{yes|no}"

Do not create an image in host-only mode, if no kernel driver is needed and no /etc/cmdline/*.conf will be generated into the initramfs (default=no).

loginstall="<directory>"

Log all files installed from the host to <directory>.

uefi="{yes|no}"

Instead of creating an initramfs image, dracut will create an UEFI executable, which can be executed by an UEFI BIOS (default=no). The default output filename is <EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi. <EFI> might be /efi, /boot or /boot/efi depending on where the ESP partition is mounted. The <BUILD_ID> is taken from BUILD_ID in /usr/lib/os-release or if it exists /etc/os-release and is left out, if BUILD_ID is non-existent or empty.

machine_id="{yes|no}"

Affects the default output filename of the UEFI executable, including the <MACHINE_ID> part (default=yes).

uefi_stub="<file>"

Specifies the UEFI stub loader, which will load the attached kernel, initramfs and kernel command line and boots the kernel. The default is /lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub.

uefi_splash_image="<file>"

Specifies the UEFI stub loader’s splash image. Requires bitmap (.bmp) image format.

uefi_secureboot_cert="<file>", uefi_secureboot_key="<file>"

Specifies a certificate and corresponding key, which are used to sign the created UEFI executable. Requires both certificate and key need to be specified and sbsign to be installed.

uefi_secureboot_engine="parameter"

Specifies an engine to use when signing the created UEFI executable. E.g. "pkcs11"

kernel_image="<file>"

Specifies the kernel image, which to include in the UEFI executable. The default is /lib/modules/<KERNEL-VERSION>/vmlinuz or /boot/vmlinuz-<KERNEL-VERSION>.

sbat="parameters"

Specifies the SBAT parameters, which to include in the UEFI executable. By default the default SBAT string added is "sbat,1,SBAT Version,sbat,1, https://github.com/rhboot/shim/blob/main/SBAT.md".

enhanced_cpio="{yes|no}"

Attempt to use the dracut-cpio binary, which optimizes archive creation for copy-on-write filesystems (default=no). When specified, initramfs archives are also padded to ensure optimal data alignment for extent sharing. To retain reflink data deduplication benefits, this should be used alongside the compress="cat" and do_strip="no" parameters, with initramfs source files, tmpdir staging area and destination all on the same copy-on-write capable filesystem.

parallel="{yes|no}"

If set to yes, try to execute tasks in parallel (currently only supported for --regenerate-all).

## FILES
/etc/dracut.conf

Old configuration file. You better use your own file in /etc/dracut.conf.d/.

/etc/dracut.conf.d/

Any /etc/dracut.conf.d/*.conf file can override the values in /etc/dracut.conf. The configuration files are read in alphanumerical order.

## AUTHOR
Harald Hoyer

## SEE ALSO
dracut(8) dracut.cmdline(7)


drbd-reactor.agentx

package: drbd-reactor

title: drbd-reactor.agentx(5)

summary: drbd-reactor agentx plugin

text:
# drbd-reactor.agentx(5)

## NAME
drbd-reactor.agentx — drbd-reactor agentx plugin

## DESCRIPTION
drbd-reactor.agentx is the SNMP plugin (via AgentX) for drbd-reactor(1).

This plugin serves a AgentX subagent for SNMP monitoring of DRBD resources exposing various DRBD metrics.

## METRICS
The plugin exposes a wide variety of metrics, for more details please check

## EXAMPLES
Configure net-snmp to include the LINBIT ID and turn on agentx:

```
...
view    systemview    included   .1.3.6.1.2.1.25.1.1
# add LINBIT ID to the system view and enable agentx
view    systemview    included   .1.3.6.1.4.1.23302
master agentx
agentXSocket tcp:127.0.0.1:705
...
```

After preparing the SNMP daemon a plugin configuration looks like this:

```
[[agentx]]
address = "localhost:705"
cache-max = 60 # seconds
agent-timeout = 60 # seconds snmpd waits for an answer
peer-states = true # include peer connection and disk states
```

## AUTHORS
The drbd-reactor(1) program was written by the following authors:

Roland Kammerer <rck@linbit.com>

Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>


drbd-reactor.debugger

title: drbd-reactor.debugger(5)

summary: drbd-reactor debugger plugin

text:
# drbd-reactor.debugger(5)

## NAME
drbd-reactor.debugger — drbd-reactor debugger plugin

## DESCRIPTION
drbd-reactor.debugger is the debugger plugin for drbd-reactor(1).

This is a simple plugin that prints change events to stderr. This is mainly useful as a simple showcase for users or plugin writers. It also helps developers to detect bugs in drbd-reactor's core.

Messages are printed on debug level, so make sure to set an apropriate log level.

## EXAMPLES

```
[[log]]
level = "debug"

## Enable the debugger
[[debugger]]
```

## AUTHORS
The drbd-reactor(1) program was written by the following authors:

Roland Kammerer <rck@linbit.com>

Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>


drbd-reactor.prometheus

title: drbd-reactor.prometheus(5)

summary: drbd-reactor prometheus plugin

text:
# drbd-reactor.prometheus(5)

## NAME
drbd-reactor.prometheus — drbd-reactor prometheus plugin

## DESCRIPTION
drbd-reactor.prometheus is the prometheus plugin for drbd-reactor(1).

This plugin provides a prometheus compatible http endpoint serving DRBD metrics.

## METRICS

- drbdreactor_up gauge: Boolean indicating whether or not drbdreactor is running. Always 1

- drbd_kernel_version gauge: Version of the loaded DRBD kernel module and DRBD utils

- drbd_connection_apinflight_bytes gauge: Number of application requests in flight (not completed)

- drbd_connection_congested gauge: Boolean whether the TCP send buffer of the data connection is more than 80% filled

- drbd_connection_rsinflight_bytes gauge: Number of resync requests in flight

- drbd_connection_state gauge: DRBD connection state

- drbd_device_alsuspended gauge: Boolean whether the Activity-Log is suspended

- drbd_device_alwrites_total counter: Number of updates of the activity log area of the meta data

- drbd_device_bmwrites_total counter: Number of updates of the bitmap area of the meta data

- drbd_device_client gauge: Boolean whether this device is a client (i.e., intentional diskless)

- drbd_device_lowerpending gauge: Number of open requests to the local I/O sub-system issued by DRBD

- drbd_device_quorum gauge: Boolean if this device has DRBD quorum

- drbd_device_read_bytes_total counter: Net data read from local hard disk

- drbd_device_size_bytes gauge: Device size in bytes

- drbd_device_state gauge: DRBD device state

- drbd_device_unintentionaldiskless gauge: Boolean whether the devices is unintentional diskless

- drbd_device_upperpending gauge: Number of block I/O requests forwarded to DRBD, but not yet answered by DRBD.

- drbd_device_written_bytes_total counter: Net data written on local disk

- drbd_peerdevice_outofsync_bytes gauge: Number of bytes currently out of sync with this peer, according to the bitmap that DRBD has for it

- drbd_peerdevice_sent_bytes: Number of bytes currently sent to this peer

- drbd_peerdevice_received_bytes: Number of bytes currently received from this peer

- drbd_resource_maypromote gauge: Boolean whether the resource may be promoted to Primary

- drbd_resource_promotionscore gauge: The promotion score (higher is better) for the resource

- drbd_resource_resources gauge: Number of resources

- drbd_resource_role gauge: DRBD role of the resource

- drbd_resource_suspended gauge: Boolean whether the resource is suspended

## EXAMPLES
Configure an exporter also generating enums on the standard port.

```
[[log]]
level = "debug"

# Enable a prometheus exporter
[[prometheus]]
enums = true
```

## AUTHORS
The drbd-reactor(1) program was written by the following authors:

Roland Kammerer <rck@linbit.com>

Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>


drbd-reactor.promoter

title: drbd-reactor.promoter(5)

summary: drbd-reactor promoter plugin

text:
# drbd-reactor.promoter(5)

## NAME
drbd-reactor.promoter — drbd-reactor promoter plugin

## DESCRIPTION
drbd-reactor.promoter is the promoter plugin for drbd-reactor(1).

The promoter plugin monitors events on resources an executes systemd units. This plugin can be used for simple high-availability.

By default the plugin generates a series of systemd service overrides (i.e., what systemd calls "Drop-In") and a systemd target unit that contains dependencies on these generated services. The services, and their order, is defined via the list specified in start.

The plugin generates two implicit extra units:

- a drbd-promote@ override that promotes the DRBD resource (i.e., switches it to Primary). This is a dependency for all the other units from start (according overrides are generated).

- a drbd-services@ target that subsumes all the generated dependencies from the start list.

Let's look at a simple example to see which overrides get generated from a dummy start list like this:

```
[[promoter]]
[promoter.resources.foo]
start = [ "a.service", "b.service", "c.service" ]
```

- /var/run/systemd/system/drbd-promote@foo.d/reactor.conf containing the necessary pieces to wait for the backing devices of DRBD resource “foo” and to promote it to Primary.

- /var/run/systemd/system/a.service.d/reactor.conf containing a dependency on drbd-promote@foo

- /var/run/systemd/system/b.service.d/reactor.conf containing dependencies on drbd-promote@foo and on a.service.

- /var/run/systemd/system/c.service.d/reactor.conf containing dependencies on drbd-promote@foo and on b.service.

- /var/run/systemd/system/drbd-services@foo.target.d/reactor.conf containing dependencies on a.service, b.service, and c.service.

If a DRBD resource changes its state to “may promote”, the plugin (i.e., all plugins on all nodes in the cluster) start the generated systemd target (e.g., drbd-services@foo.target ). All will try to start the drbd-promote@ unit first, but only one will succeed and continue to start the rest of the services. All the others will fail intentionally.

In order to promote the resource with the best disk state, the plugin evaluates its local disk states and waits a short period of time, which might give a promoter on another host the chance (i.e., because its sleep time is shorter) to promote the resource first. Sleep times are calculated as follows:

DiskState

Sleep time in seconds

Diskless

6

Attaching

6

Detaching

6

Failed

6

Negotiating

6

Unknown

6

Inconsistent

3

Outdated

2

Consistent

1

UpToDate

0

The actual sleep time is calculated as the worst case of all the volumes in a resource and can be scaled by setting sleep-before-promote-factor.

If a resource loses “quorum”, it stops the systemd drbd-services@ target and all the dependencies. Stopping services on the node that lost quorum is the standard behavior one would expect from a cluster manger. There might be scenarios where it is preferable to freeze the started service until quorum is gained again. As this requires multiple prerequisites to hold true, freezing a resource on quorum loss is described in FREEZING RESOURCES.

The plugin's configuration can contain an action that is executed if a stop action fails (e.g., triggering a reboot). Start actions in start are interpreted as systemd.unit(5). and have to have an according postfix like .service or .mount. ocf resource agents are supported via the ocf.rs@ service. Please see OCF RESOURCE AGENTS for a detailed overview.

The configuration can contain a setting that specifies that resources are stopped whenever the plugin exits (e.g., on service restart).

It also contains a runner that can be set to shell. Then the items in start are interpreted as shell scripts and started in order (no explicit targets or anything) and stopped in reverse order or as defined via stop. This can be used on systems without systemd and might be useful for Windows systems in the future. If you can, use the default systemd method, it is the preferred one.

In order for DRBD to use quorum as needed by this plugin, make sure the resource file of the DRBD resource contains the following option (this is the default for LINSTOR, but your resources needs to qualify for quorum).

```
options {
   auto-promote no;
   quorum majority;
   on-suspended-primary-outdated force-secondary;
   on-no-quorum io-error; # for the default drbd-reactor on-quorum-loss policy (i.e., Shutdown)
   # on-no-quorum suspend-io; # for freezing resources
   on-no-data-accessible io-error # always set this to the value of on-no-quorum!
   # on-no-data-accessible suspend-io # for freezing, always set this to the value of on-no-quorum!
}
# net { rr-conflict retry-connect; } # for freezing resources
```

drbd-reactor itself is pretty relaxed about these settings, don't expect too much hand holding or even auto-configuration, you as the admin are the one that should understand your system, but it checks properties and writes warnings to the log (file/journal) if misconfiguration is detected.

## SERVICE DEPENDENCIES
Let's get back to our simple example:

```
[[promoter]]
[promoter.resources.foo]
start = [ "a.service", "b.service", "c.service" ]
```

As we noted in previously we generate a dependency chain for these services (i.e., all depend on drbd-promote@ as well as on the previous services). The strictness of these dependencies can be set via dependencies-as , where the default is Requires systemd.unit(5)

We also generate the mentioned drbd-services@.target , which lists all the services from start. The dependencies for that are generated via the value set in target-as.

Especially when one debugs services it might make sense to lower these defaults to for example Wants. Otherwise a failed service might prohibit a successful start of the drbd-services@.target , which then triggers a stop of the target and its dependencies, which might again trigger a start because the resource is DRBD promotable again and so on.

It is really up to you and how strict/hard you want your dependencies and what their outcome should be. Requires should be a good default, you might lower or increase the strictness depending on the scenario.

## OCF RESOURCE AGENTS
It is possible to use resource agents in the start list of services via ocf:$vendor:$agent instance-id name=value ... The instance-id is user defined and gets postfixed with _$resourcename. For example the generated systemd unit for an instance-id of “p_iscsi_demo1” for a DRBD resource “foo” would be ocf.rs@p_iscsi_demo1_foo. name / value pairs are passed to the unit as environment variables prefixed with OCF_RESKEY_. In a concrete example using the “heartbeat:IPaddr2” agent this could look like this:

```
start = [
  "foo.service",
  "ocf:heartbeat:IPaddr2 p_iscsi_demo1_ip ip=10.43.7.223 cidr_netmask=16",
  "bar.service"
]
```

## FREEZING RESOURCES
The default behavior when a DRBD Primary loses quorum is to immediately stop the generated target unit and hope that other nodes still having quorum will successfully start the service. This works well if services can be failed over/started on another node in reasonable time. Unfortunately there are services that take a very long time to start, for example huge data bases.

When a DRBD Primary loses its quorum we basically have two possibilities:

- the rest of the nodes, or at least parts of it still have quorum: Then these have to start the service, they are the only ones with quorum, but still we could keep the old Primary in a frozen state. And then, when the nodes with quorum come into contact with the old Primary, then it should stop the service and its storage should become in sync with the other nodes.

- the rest of the nodes are not able to form a partition with quorum. In such a scenario there are no alternatives anyways, we would need to keep the Primary frozen. But if the nodes eventually join the old Primary again, and quorum would be restored, we could just unfreeze/thaw the old Primary (which is also the new Primary).

There are several requirements for this to work properly:

- A system with unified cgroups. If the file /sys/fs/cgroup/cgroup.controllers exists you should be fine. That requires a relatively “new” kernel. Note that “even” RHEL8 for example needs the addition of systemd.unified_cgroup_hierarchy on the kernel command line.

- a service that can tolerate to be frozen

- DRBD option on-suspended-primary-outdated set to force-secondary

- DRBD option on-no-quorum set to suspend-io

- DRBD option on-no-data-accessible set to suspend-io

- DRBD net option rr-conflict set to retry-connect

If these requirements are fulfilled, then one can set the promoter option on-quorum-loss to freeze.

## PREFERRED NODES
While in a HA cluster that deserves the name every node needs to be able to run all services, some users like to add preferences for nodes. This can be done by setting a list of preferred-nodes. On resource startup a delay based on the node's position in the list is added. Node names need to match the output of uname -n. Nodes with a lower preference will sleep longer. By default, if a node joins on DRBD level, and that peer's disk becomes UpToDate, and the peer has a higher preference, then the active node stops the services locally. As it will then have a higher sleep penalty as the preferred node, the preferred one will take over the service (if it can). If preferred-nodes-policy is set to always the system behaves as described above. If it is set to start-only, then preferred nodes are only taken into account when a service can be startet, but it will not fall back to a more preferred node when the service is already running on a lower priority node and a higher priority nodes joins later.

## FILES
/usr/lib/ocf/resource.d/

Path used for for OCF agents.

## EXAMPLES
This configures a promoter for resource “foo”. If the resource might be promoted the “foo.mount” and “foo.service” units get started. On DRBD demote failures a systemd "reboot" is triggered.

```
[promoter.resources.foo]
start = ["foo.mount", "foo.service"]
on-drbd-demote-failure =  "reboot"
stop-services-on-exit = false
preferred-nodes = ["nodeA", "nodeB" ]
```

## SEE ALSO
For further design notes and handled failure scenarios see doc/promoter.md in the source code. An online version is available at promoter.md

## AUTHORS
The drbd-reactor(1) program was written by the following authors:

Roland Kammerer <rck@linbit.com>

Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>


drbd-reactor.toml

title: drbd-reactor.toml(5)

summary: DRBD-REACTOR daemon configuration file

text:
# drbd-reactor.toml(5)

## NAME
drbd-reactor.toml — DRBD-REACTOR daemon configuration file

## DESCRIPTION
drbd-reactor.toml is the configuration file for the DRBD-REACTOR daemon, drbd-reactor(1). The file has to be valid toml file.

The configuration file consists of sections for global settings, logging, and the actual plugin configuration. While this is rarely used and should be used with caution, it is possible to have multiple instances of a plugin as well as multiple loggers. The program ships with a commented version of the configuration file, please refer to that for further details.

Note that plugin settings are shown here for demonstration purposes only, plugin configuration should be stored in /etc/drbd-reactor.d/

## EXAMPLES

```
snippets = "/etc/drbd-reactor.d"
# update statistics every 45 seconds
statistics-poll-interval = 45

[[log]]
level = "debug"

# Configure a promoter
[[promoter]]
[promoter.resources.foo]
start = ["foo.mount", "foo.service"]
on-drbd-demote-failure = "reboot"

# Configure a user mode helper filter
[[umh]]
[[umh.resource]]
command = "drbd-reactor-role-change.sh"
event-type = "Change"
old.role = { operator = "NotEquals", value = "Primary" }
new.role = "Primary"

# Configure a prometheus exporter
[[prometheus]]
enums = true

# Configure an agentx subagent
[[agentx]]
peer-states = false
```

## AUTHORS
The drbd-reactor(1) program was written by the following authors:

Roland Kammerer <rck@linbit.com>

Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>

## CAVEATS
Please note that the path specified in snippets gets path-joined with “*.toml” and the result is then subject to glob expansion.


drbd-reactor.umh

title: drbd-reactor.umh(5)

summary: drbd-reactor user mode helper plugin

text:
# drbd-reactor.umh(5)

## NAME
drbd-reactor.umh — drbd-reactor user mode helper plugin

## DESCRIPTION
drbd-reactor.umh is the user mode helper plugin for drbd-reactor(1).

The user mode helper is a plugin that allows users to specify filters matched on DRBD state changes. If a filter rule matches, a user defined script gets executed. Information is passed to scripts via environment variables. For every event all rules are evaluated, so if multiple rules match, multiple actions are executed (concurrently).

There are 4 different types a rule can be defined for:

- RESOURCE RULES

- DEVICE RULES

- PEER DEVICE RULES

- CONNECTION RULES

It is important to note that fields not specified do not restrict the filter. Think of them as “don't care”. Make sure to read and understand the implied CAVEATS section.

## COMMON FIELDS
Every rule type (e.g., resource, device,...) has a set of common fields

Common fields

Description

Type

Mandatory

name

Name of the rule written to logs

String

no

command

Command/script to execute via sh -c

String

yes

env

User defined env variables

Map

no

Every type also has a common set of filters that can be used for matching.

Common filters

Description

Type

resource-name

Name of the DRBD resource

String

event-type

Type of the event

EventType

## STATE CHANGES
Every field shown in this section marked as state change can be set on the old and/or new section of a rule. This can be used to filter state changes (e.g., from Secondary to Primary ).

### RESOURCE RULES
Fields

Description

Type

State change

role

Role of the resource

Role

yes

may-promote

If the resource may be promoted

Boolean

yes

A match on such a rule calls the specified command and sets the following environment variables:

DRBD_RES_NAME

Name of the DRBD resource

DRBD_{OLD,NEW}_ROLE

Role of the resource

DRBD_{OLD,NEW}_MAY_PROMOTE

Resource may be promoted to Primary

### DEVICE RULES
Fields

Description

Type

State change

volume

Volume number

Integer

no

disk-state

Disk state of the device

DiskState

yes

client

Device is a DRBD client

Boolean

yes

quorum

Device has DRBD quorum

Boolean

yes

open

Device is opened

Boolean

yes

A match on such a rule calls the specified command and sets the following environment variables:

DRBD_RES_NAME

Name of the DRBD resource

DRBD_MINOR

Minor number of the device

DRBD_MINOR_$volume

Minor number of the device by volume

DRBD_VOLUME

volume (number) of the device

DRBD_BACKING_DEV

Block device path to backing device or “none”

DRBD_BACKING_DEV_$volume

Block device path to backing device or “none” by volume

DRBD_{OLD,NEW}_DISK_STATE

DiskState of the device

DRBD_{OLD,NEW}_CLIENT

Device was/is a DRBD client

DRBD_{OLD,NEW}_QUORUM

Device had/has DRBD qourum

DRBD_{OLD,NEW}_OPEN

Device was/is opened

### PEER DEVICE RULES
Fields

Description

Type

State change

volume

Volume number

Integer

no

peer-node-id

Node ID of the Peer

Integer

no

peer-disk-state

Disk state of the peer-device

DiskState

yes

peer-client

Peer-device is a DRBD client

Boolean

yes

resync-suspended

DRBD resync is suspended

Boolean

yes

replication-state

Replication state

ReplicationState

yes

A match on such a rule calls the specified command and sets the following environment variables:

DRBD_{OLD,NEW}_DISK_STATE

DiskState of the device

DRBD_RES_NAME

Name of the DRBD resource

DRBD_MINOR

Minor number of the device

DRBD_MINOR_$volume

Minor number of the device by volume

DRBD_VOLUME

volume (number) of the device

DRBD_BACKING_DEV

Block device path to backing device or “none”

DRBD_BACKING_DEV_$volume

Block device path to backing device or “none” by volume

DRBD_PEER_NODE_ID

Node ID of the peer

DRBD_{OLD,NEW}_PEER_DISK_STATE

DiskState of the peer-device

DRBD_{OLD,NEW}_PEER_CLIENT

Peer-device was/is a DRBD client

DRBD_{OLD,NEW}_PEER_RESYNC_SUSPENDED

Resync was/is suspended

DRBD_{OLD,NEW}_PEER_REPLICATION_STATE

ReplicationState

A note on DRBD_BACKING_DEV* : DRBD does not know the backing device path of its peer, so the device set in these variables is the local backing device path! Usually the backing device names on all peers are the same for diskful nodes, but it is not strictly required. This was not invented by drbd-reactor(1), this is how these variables always have been set when DRBD kernel called user mode helpers from kernel space. So this might be unexpected, but that is what it always was.

### CONNECTION RULES
Fields

Description

Type

State change

peer-node-id

Node ID of the Peer

Integer

no

conn-name

Name of the connection

String

yes

connection-state

Connection state

ConnectionState

yes

peer-role

Peer role

Role

yes

congested

Connection is congested

Boolean

yes

A match on such a rule calls the specified command and sets the following environment variables:

DRBD_RES_NAME

Name of the DRBD resource

DRBD_PEER_NODE_ID

Node ID of the peer

DRBD_CSTATE

Connection state

DRBD_{OLD,NEW}_CONN_NAME

Conneciton name

DRBD_{OLD,NEW}_CONN_STATE

Connection state

DRBD_{OLD,NEW}_PEER_ROLE

Peer role

DRBD_{OLD,NEW}_CONGESTED

Connection was/is congested

## ENVIRONMENT
Before a command is executed its environment gets deleted. Then the common environment variables in this section are set, followed by the filter type specific environment variables, and the user defined ones.

HOME

“/”

TERM

“Linux”

PATH

“/sbin:/usr/sbin:/bin:/usr/bin”

## OPERATORS
Currently filters that are set are compared for equality with the value received in a state update. One handy operator is "not equal", meaning everthing except the given value. We have to play within the boundaries of toml, and we did not want to sacrifice type safety we get for free from the parser by inventing our own “filter language”.

The default comparison operator is Equals

old.role = Primary # compares for equality

If another operator should be used, one has to specify the value and the operator

```
old.role = { operator = "NotEquals", value = "Primary" }
# which is toml equivalent to these two lines:
old.role.operator = "NotEquals"
old.role.value = "Primary"
```

It is not possible to mix and match these two notations:

```
old.role.operator = "NotEquals"
old.role = "Primary"  # fails. it requires a .value in this case
```

The allowed operators are:

- Equals (the default)

- NotEquals

## TYPES

### EVENT TYPES

- Exists

- Create

- Destroy

- Change

### RESOURCE ROLES

- Unknown

- Primary

- Secondary

### DISK STATES

- Diskless

- Attaching

- Detaching

- Failed

- Negotiating

- Inconsistent

- Outdated

- DUnknown

- Consistent

- UpToDate

### REPLICATION STATES

- Off

- Established

- StartingSyncS

- StartingSyncT

- WFBitMapS

- WFBitMapT

- WFSyncUUID

- SyncSource

- SyncTarget

- VerifyS

- VerifyT

- PausedSyncS

- PausedSyncT

- Ahead

- Behind

### CONNECTION STATES

- StandAlone

- Disconnecting

- Unconnected

- Timeout

- BrokenPipe

- NetworkFailure

- ProtocolError

- TearDown

- Connecting

- Connected

## EXAMPLES
Configure a user mode helper filter of type resource.

```
[[umh]]
[[umh.resource]]
command = "slack.sh $DRBD_RES_NAME on $(uname -n) from $DRBD_OLD_ROLE to $DRBD_NEW_ROLE"
event-type = "Change"
old.role = { operator = "NotEquals", value = "Primary" }
new.role = "Primary"
```

## AUTHORS
The drbd-reactor(1) program was written by the following authors:

Roland Kammerer <rck@linbit.com>

Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>

## CAVEATS
As it was mentioned before, fields that are not set are not taken into consideration when matching the filter. Let's look at how one might write a filter:

```
[[umh.resource]]
command = "/usr/local/bin/primary.sh"
resource-name = "foo"
new.role = "Primary"
```

What this means is that this filter does *not* care about the state of the old role. So if the resource changes for whatever reason, not related to it's role, an update is sent and the current state is matched against the rule. In this case it would trigger as the the role "changes" from the old state “don't care” (i.e., already Primary) to current/new state Primary.

Most rules are written to match specific state changes anyways, so a natural fit would be:

```
[[umh.resource]]
command = "/usr/local/bin/primary.sh"
resource-name = "foo"
old.role = "Secondary"
new.role = "Primary"
```

Another possibility for more complex fields than a resource's role, capturing everthing besides a given target value look like this. See section OPERATORS for details:

```
[[umh.resource]]
command = "/usr/local/bin/primary.sh"
resource-name = "foo"
old.role = { operator = "NotEquals", value = "Primary" }
new.role = "Primary"
```


package: drbd-utils

title: drbd.conf-8.4(5)

summary: Configuration file for DRBD\*(Aqs devices

text:
# drbd.conf-8.4(5)

## NAME
drbd.conf - Configuration file for DRBD's devices

## INTRODUCTION
The file /etc/drbd.conf is read by drbdadm.

The file format was designed as to allow to have a verbatim copy of the file on both nodes of the cluster. It is highly recommended to do so in order to keep your configuration manageable. The file /etc/drbd.conf should be the same on both nodes of the cluster. Changes to /etc/drbd.conf do not apply immediately.

By convention the main config contains two include statements. The first one includes the file /etc/drbd.d/global_common.conf, the second one all file with a .res suffix.

```
resource r0 {
	net {
		protocol C;
		cram-hmac-alg sha1;
		shared-secret "FooFunFactory";
	}
	disk {
		resync-rate 10M;
	}
	on alice {
		volume 0 {
			device    minor 1;
			disk      /dev/sda7;
			meta-disk internal;
		}
		address   10.1.1.31:7789;
	}
	on bob {
		volume 0 {
			device    minor 1;
			disk      /dev/sda7;
			meta-disk internal;
		}
		address   10.1.1.32:7789;
	}
}
```

In this example, there is a single DRBD resource (called r0) which uses protocol C for the connection between its devices. It contains a single volume which runs on host alice uses /dev/drbd1 as devices for its application, and /dev/sda7 as low-level storage for the data. The IP addresses are used to specify the networking interfaces to be used. An eventually running resync process should use about 10MByte/second of IO bandwidth. This resync-rate statement is valid for volume 0, but would also be valid for further volumes. In this example it assigns full 10MByte/second to each volume.

There may be multiple resource sections in a single drbd.conf file. For more examples, please have a look at the DRBD User's Guide[1].

## FILE FORMAT
The file consists of sections and parameters. A section begins with a keyword, sometimes an additional name, and an opening brace (“{”). A section ends with a closing brace (“}”. The braces enclose the parameters.

section [name] { parameter value; [...] }

A parameter starts with the identifier of the parameter followed by whitespace. Every subsequent character is considered as part of the parameter's value. A special case are Boolean parameters which consist only of the identifier. Parameters are terminated by a semicolon (“;”).

Some parameter values have default units which might be overruled by K, M or G. These units are defined in the usual way (K = 2^10 = 1024, M = 1024 K, G = 1024 M).

Comments may be placed into the configuration file and must begin with a hash sign (“#”). Subsequent characters are ignored until the end of the line.

### Sections
skip

Comments out chunks of text, even spanning more than one line. Characters between the keyword skip and the opening brace (“{”) are ignored. Everything enclosed by the braces is skipped. This comes in handy, if you just want to comment out some 'resource [name] {...}' section: just precede it with 'skip'.

global

Configures some global parameters. Currently only minor-count, dialog-refresh, disable-ip-verification and usage-count are allowed here. You may only have one global section, preferably as the first section.

common

All resources inherit the options set in this section. The common section might have a startup, a options, a handlers, a net and a disk section.

resource name

Configures a DRBD resource. Each resource section needs to have two (or more) on host sections and may have a startup, a options, a handlers, a net and a disk section. It might contain volumes sections.

on host-name

Carries the necessary configuration parameters for a DRBD device of the enclosing resource. host-name is mandatory and must match the Linux host name (uname -n) of one of the nodes. You may list more than one host name here, in case you want to use the same parameters on several hosts (you'd have to move the IP around usually). Or you may list more than two such sections.

```
	resource r1 {
		protocol C;
		device minor 1;
		meta-disk internal;
		on alice bob {
			address 10.2.2.100:7801;
			disk /dev/mapper/some-san;
		}
		on charlie {
			address 10.2.2.101:7801;
			disk /dev/mapper/other-san;
		}
		on daisy {
			address 10.2.2.103:7801;
			disk /dev/mapper/other-san-as-seen-from-daisy;
		}
	}

```

See also the floating section keyword. Required statements in this section: address and volume. Note for backward compatibility and convenience it is valid to embed the statements of a single volume directly into the host section.

volume vnr

Defines a volume within a connection. The minor numbers of a replicated volume might be different on different hosts, the volume number (vnr) is what groups them together. Required parameters in this section: device, disk, meta-disk.

stacked-on-top-of resource

For a stacked DRBD setup (3 or 4 nodes), a stacked-on-top-of is used instead of an on section. Required parameters in this section: device and address.

floating AF addr:port

Carries the necessary configuration parameters for a DRBD device of the enclosing resource. This section is very similar to the on section. The difference to the on section is that the matching of the host sections to machines is done by the IP-address instead of the node name. Required parameters in this section: device, disk, meta-disk, all of which may be inherited from the resource section, in which case you may shorten this section down to just the address identifier.

```
	resource r2 {
		protocol C;
		device minor 2;
		disk      /dev/sda7;
		meta-disk internal;
		# short form, device, disk and meta-disk inherited
		floating 10.1.1.31:7802;
		# longer form, only device inherited
		floating 10.1.1.32:7802 {
			disk /dev/sdb;
			meta-disk /dev/sdc8;
		}
	}

```

disk

This section is used to fine tune DRBD's properties in respect to the low level storage. Please refer to drbdsetup(8) for detailed description of the parameters. Optional parameters: on-io-error, size, fencing, disk-barrier, disk-flushes, disk-drain, md-flushes, max-bio-bvecs, resync-rate, resync-after, al-extents, al-updates, c-plan-ahead, c-fill-target, c-delay-target, c-max-rate, c-min-rate, disk-timeout, discard-zeroes-if-aligned, rs-discard-granularity, read-balancing.

net

This section is used to fine tune DRBD's properties. Please refer to drbdsetup(8) for a detailed description of this section's parameters. Optional parameters: protocol, sndbuf-size, rcvbuf-size, timeout, connect-int, ping-int, ping-timeout, max-buffers, max-epoch-size, ko-count, allow-two-primaries, cram-hmac-alg, shared-secret, after-sb-0pri, after-sb-1pri, after-sb-2pri, data-integrity-alg, no-tcp-cork, on-congestion, congestion-fill, congestion-extents, verify-alg, use-rle, csums-alg, socket-check-timeout.

startup

This section is used to fine tune DRBD's properties. Please refer to drbdsetup(8) for a detailed description of this section's parameters. Optional parameters: wfc-timeout, degr-wfc-timeout, outdated-wfc-timeout, wait-after-sb, stacked-timeouts and become-primary-on.

options

This section is used to fine tune the behaviour of the resource object. Please refer to drbdsetup(8) for a detailed description of this section's parameters. Optional parameters: cpu-mask, and on-no-data-accessible.

handlers

In this section you can define handlers (executables) that are started by the DRBD system in response to certain events. Optional parameters: pri-on-incon-degr, pri-lost-after-sb, pri-lost, fence-peer (formerly oudate-peer), local-io-error, initial-split-brain, split-brain, before-resync-target, after-resync-target.

The interface is done via environment variables:

•DRBD_RESOURCE is the name of the resource

•DRBD_MINOR is the minor number of the DRBD device, in decimal.

•DRBD_CONF is the path to the primary configuration file; if you split your configuration into multiple files (e.g. in /etc/drbd.conf.d/), this will not be helpful.

•DRBD_PEER_AF , DRBD_PEER_ADDRESS , DRBD_PEERS are the address family (e.g. ipv6), the peer's address and hostnames.

DRBD_PEER is deprecated.

Please note that not all of these might be set for all handlers, and that some values might not be useable for a floating definition.

### Parameters
minor-count count

count may be a number from 1 to 1048575. Minor-count is a sizing hint for DRBD. It helps to right-size various memory pools. It should be set in the in the same order of magnitude than the actual number of minors you use. Per default the module loads with 11 more resources than you have currently in your config but at least 32.

dialog-refresh time

time may be 0 or a positive number. The user dialog redraws the second count every time seconds (or does no redraws if time is 0). The default value is 1.

disable-ip-verification

Use disable-ip-verification if, for some obscure reasons, drbdadm can/might not use ip or ifconfig to do a sanity check for the IP address. You can disable the IP verification with this option.

udev-always-use-vnr

When udev asks drbdadm for a list of device related symlinks, drbdadm would suggest symlinks with differing naming conventions, depending on whether the resource has explicit volume VNR { } definitions, or only one single volume with the implicit volume number 0:

```
# implicit single volume without "volume 0 {}" block
DEVICE=drbd<minor>
SYMLINK_BY_RES=drbd/by-res/<resource-name>
# explicit volume definition: volume VNR { }
DEVICE=drbd<minor>
SYMLINK_BY_RES=drbd/by-res/<resource-name>/VNR
```

If you define this parameter in the global section, drbdadm will always add the .../VNR part, and will not care for whether the volume definition was implicit or explicit.

For legacy backward compatibility, this is off by default, but we do recommend to enable it.

usage-count val

Please participate in DRBD's online usage counter[2]. The most convenient way to do so is to set this option to yes. Valid options are: yes, no and ask.

protocol prot-id

On the TCP/IP link the specified protocol is used. Valid protocol specifiers are A, B, and C. Protocol A: write IO is reported as completed, if it has reached local disk and local TCP send buffer.

Protocol B: write IO is reported as completed, if it has reached local disk and remote buffer cache.

Protocol C: write IO is reported as completed, if it has reached both local and remote disk.

device name minor nr

The name of the block device node of the resource being described. You must use this device with your application (file system) and you must not use the low level block device which is specified with the disk parameter.

One can ether omit the name or minor and the minor number. If you omit the name a default of /dev/drbdminor will be used.

Udev will create additional symlinks in /dev/drbd/by-res and /dev/drbd/by-disk.

disk name

DRBD uses this block device to actually store and retrieve the data. Never access such a device while DRBD is running on top of it. This also holds true for dumpe2fs(8) and similar commands.

address AF addr:port

A resource needs one IP address per device, which is used to wait for incoming connections from the partner device respectively to reach the partner device. AF must be one of ipv4, ipv6, ssocks or sdp (for compatibility reasons sci is an alias for ssocks). It may be omited for IPv4 addresses. The actual IPv6 address that follows the ipv6 keyword must be placed inside brackets: ipv6 [fd01:2345:6789:abcd::1]:7800.

Each DRBD resource needs a TCP port which is used to connect to the node's partner device. Two different DRBD resources may not use the same addr:port combination on the same node.

meta-disk internal,

meta-disk device,

meta-disk device [index]

Internal means that the last part of the backing device is used to store the meta-data. The size of the meta-data is computed based on the size of the device.

When a device is specified, either with or without an index, DRBD stores the meta-data on this device. Without index, the size of the meta-data is determined by the size of the data device. This is usually used with LVM, which allows to have many variable sized block devices. The meta-data size is 36kB + Backing-Storage-size / 32k, rounded up to the next 4kb boundary. (Rule of the thumb: 32kByte per 1GByte of storage, rounded up to the next MB.)

When an index is specified, each index number refers to a fixed slot of meta-data of 128 MB, which allows a maximum data size of 4 TiB. This way, multiple DBRD devices can share the same meta-data device. For example, if /dev/sde6[0] and /dev/sde6[1] are used, /dev/sde6 must be at least 256 MB big. Because of the hard size limit, use of meta-disk indexes is discouraged.

on-io-error handler

handler is taken, if the lower level device reports io-errors to the upper layers. handler may be pass_on, call-local-io-error or detach.

pass_on: The node downgrades the disk status to inconsistent, marks the erroneous block as inconsistent in the bitmap and retries the IO on the remote node.

call-local-io-error: Call the handler script local-io-error.

detach: The node drops its low level device, and continues in diskless mode.

fencing fencing_policy

By fencing we understand preventive measures to avoid situations where both nodes are primary and disconnected (AKA split brain).

Valid fencing policies are:

dont-care

This is the default policy. No fencing actions are taken.

resource-only

If a node becomes a disconnected primary, it tries to fence the peer's disk. This is done by calling the fence-peer handler. The handler is supposed to reach the other node over alternative communication paths and call 'drbdadm outdate res' there.

resource-and-stonith

If a node becomes a disconnected primary, it freezes all its IO operations and calls its fence-peer handler. The fence-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 resume-io command.

disk-barrier,

disk-flushes,

disk-drain

DRBD has four implementations to express write-after-write dependencies to its backing storage device. DRBD will use the first method that is supported by the backing storage device and that is not disabled. By default the flush method is used. Since drbd-8.4.2 disk-barrier is disabled by default because since linux-2.6.36 (or 2.6.32 RHEL6) there is no reliable way to determine if queuing of IO-barriers works. Dangerous only enable if you are told so by one that knows for sure.

When selecting the method you should not only base your decision on the measurable performance. In case your backing storage device has a volatile write cache (plain disks, RAID of plain disks) you should use one of the first two. In case your backing storage device has battery-backed write cache you may go with option 3. Option 4 (disable everything, use "none") is dangerous on most IO stacks, may result in write-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles. Do not use no-disk-drain.

Unfortunately device mapper (LVM) might not support barriers.

The letter after "wo:" in /proc/drbd indicates with method is currently in use for a device: b, f, d, n. The implementations are:

barrier

The first requires that the driver of the backing storage device support barriers (called 'tagged command queuing' in SCSI and 'native command queuing' in SATA speak). The use of this method can be enabled by setting the disk-barrier options to yes.

flush

The second requires that the backing device support disk flushes (called 'force unit access' in the drive vendors speak). The use of this method can be disabled setting disk-flushes to no.

drain

The third method is simply to let write requests drain before write requests of a new reordering domain are issued. This was the only implementation before 8.0.9.

none

The fourth method is to not express write-after-write dependencies to the backing store at all, by also specifying no-disk-drain. This is dangerous on most IO stacks, may result in write-reordering, and if so, can theoretically be the reason for data corruption, or disturb the DRBD protocol, causing spurious disconnect/reconnect cycles. Do not use no-disk-drain.

md-flushes

Disables the use of disk flushes and barrier BIOs when accessing the meta data device. See the notes on disk-flushes.

max-bio-bvecs

In some special circumstances the device mapper stack manages to pass BIOs to DRBD that violate the constraints that are set forth by DRBD's merge_bvec() function and which have more than one bvec. A known example is: phys-disk -> DRBD -> LVM -> Xen -> misaligned partition (63) -> DomU FS. Then you might see "bio would need to, but cannot, be split:" in the Dom0's kernel log. The best workaround is to proper align the partition within the VM (E.g. start it at sector 1024). This costs 480 KiB of storage. Unfortunately the default of most Linux partitioning tools is to start the first partition at an odd number (63). Therefore most distribution's install helpers for virtual linux machines will end up with misaligned partitions. The second best workaround is to limit DRBD's max bvecs per BIO (= max-bio-bvecs) to 1, but that might cost performance.

The default value of max-bio-bvecs is 0, which means that there is no user imposed limitation.

disk-timeout

If the lower-level device on which a DRBD device stores its data does not finish an I/O request within the defined disk-timeout, DRBD treats this as a failure. The lower-level device is detached, and the device's disk state advances to Diskless. If DRBD is connected to one or more peers, the failed request is passed on to one of them. This option is dangerous and may lead to kernel panic!

"Aborting" requests, or force-detaching the disk, is intended for completely blocked/hung local backing devices which do no longer complete requests at all, not even do error completions. In this situation, usually a hard-reset and failover is the only way out.

By "aborting", basically faking a local error-completion, we allow for a more graceful swichover by cleanly migrating services. Still the affected node has to be rebooted "soon".

By completing these requests, we allow the upper layers to re-use the associated data pages.

If later the local backing device "recovers", and now DMAs some data from disk into the original request pages, in the best case it will just put random data into unused pages; but typically it will corrupt meanwhile completely unrelated data, causing all sorts of damage.

Which means delayed successful completion, especially for READ requests, is a reason to panic(). We assume that a delayed *error* completion is OK, though we still will complain noisily about it.

The default value of disk-timeout is 0, which stands for an infinite timeout. Timeouts are specified in units of 0.1 seconds. This option is available since DRBD 8.3.12.

discard-zeroes-if-aligned {yes | no}

There are several aspects to discard/trim/unmap support on linux block devices. Even if discard is supported in general, it may fail silently, or may partially ignore discard requests. Devices also announce whether reading from unmapped blocks returns defined data (usually zeroes), or undefined data (possibly old data, possibly garbage).

If on different nodes, DRBD is backed by devices with differing discard characteristics, discards may lead to data divergence (old data or garbage left over on one backend, zeroes due to unmapped areas on the other backend). Online verify would now potentially report tons of spurious differences. While probably harmless for most use cases (fstrim on a file system), DRBD cannot have that.

To play safe, we have to disable discard support, if our local backend (on a Primary) does not support "discard_zeroes_data=true". We also have to translate discards to explicit zero-out on the receiving side, unless the receiving side (Secondary) supports "discard_zeroes_data=true", thereby allocating areas what were supposed to be unmapped.

There are some devices (notably the LVM/DM thin provisioning) that are capable of discard, but announce discard_zeroes_data=false. In the case of DM-thin, discards aligned to the chunk size will be unmapped, and reading from unmapped sectors will return zeroes. However, unaligned partial head or tail areas of discard requests will be silently ignored.

If we now add a helper to explicitly zero-out these unaligned partial areas, while passing on the discard of the aligned full chunks, we effectively achieve discard_zeroes_data=true on such devices.

Setting discard-zeroes-if-aligned to yes will allow DRBD to use discards, and to announce discard_zeroes_data=true, even on backends that announce discard_zeroes_data=false.

Setting discard-zeroes-if-aligned to no will cause DRBD to always fall-back to zero-out on the receiving side, and to not even announce discard capabilities on the Primary, if the respective backend announces discard_zeroes_data=false.

We used to ignore the discard_zeroes_data setting completely. To not break established and expected behaviour, and suddenly cause fstrim on thin-provisioned LVs to run out-of-space instead of freeing up space, the default value is yes.

This option is available since 8.4.7.

--disable-write-same {yes | no}

Some disks announce WRITE_SAME support to the kernel but fail with an I/O error upon actually receiving such a request. This mostly happens when using virtualized disks -- notably, this behavior has been observed with VMware's virtual disks.

When disable-write-same is set to yes, WRITE_SAME detection is manually overriden and support is disabled.

The default value of disable-write-same is no. This option is available since 8.4.7.

read-balancing method

The supported methods for load balancing of read requests are prefer-local, prefer-remote, round-robin, least-pending, when-congested-remote, 32K-striping, 64K-striping, 128K-striping, 256K-striping, 512K-striping and 1M-striping. The default value of read-balancing is prefer-local. This option is available since 8.4.1.

rs-discard-granularity byte

When rs-discard-granularity is set to a non zero, positive value then DRBD tries to do a resync operation in requests of this size. In case such a block contains only zero bytes on the sync source node, the sync target node will issue a discard/trim/unmap command for the area. The value is constrained by the discard granularity of the backing block device. In case rs-discard-granularity is not a multiplier of the discard granularity of the backing block device DRBD rounds it up. The feature only gets active if the backing block device reads back zeroes after a discard command.

The default value of rs-discard-granularity is 0. This option is available since 8.4.7.

sndbuf-size size

size is the size of the TCP socket send buffer. The default value is 0, i.e. autotune. You can specify smaller or larger values. Larger values are appropriate for reasonable write throughput with protocol A over high latency networks. Values below 32K do not make sense. Since 8.0.13 resp. 8.2.7, setting the size value to 0 means that the kernel should autotune this.

rcvbuf-size size

size is the size of the TCP socket receive buffer. The default value is 0, i.e. autotune. You can specify smaller or larger values. Usually this should be left at its default. Setting the size value to 0 means that the kernel should autotune this.

timeout time

If the partner node fails to send an expected response packet within time tenths of a second, the partner node is considered dead and therefore the TCP/IP connection is abandoned. This must be lower than connect-int and ping-int. The default value is 60 = 6 seconds, the unit 0.1 seconds.

connect-int time

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 retries. The default value is 10 seconds, the unit is 1 second.

ping-int time

If the TCP/IP connection linking a DRBD device pair is idle for more than time seconds, DRBD will generate a keep-alive packet to check if its partner is still alive. The default is 10 seconds, the unit is 1 second.

ping-timeout time

The time the peer has time 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 are tenths of a second.

max-buffers number

Limits the memory usage per DRBD minor device on the receiving side, or for internal buffers during resync or online-verify. Unit is PAGE_SIZE, which is 4 KiB on most systems. The minimum possible setting is hard coded to 32 (=128 KiB). These buffers are used to hold data blocks while they are written to/read from disk. To avoid possible distributed deadlocks on congestion, this setting is used as a throttle threshold rather than a hard limit. Once more than max-buffers pages are in use, further allocation from this pool is throttled. You want to increase max-buffers if you cannot saturate the IO backend on the receiving side.

ko-count number

In case the secondary node fails to complete a single write request for count times the timeout, it is expelled from the cluster. (I.e. the primary node will kill and restart the connection.) To disable this feature, you should explicitly set it to 0; defaults may change between versions.

max-epoch-size number

The highest number of data blocks between two write barriers. If you set this smaller than 10, you might decrease your performance.

allow-two-primaries

With this option set you may assign the 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!

unplug-watermark number

This setting has no effect with recent kernels that use explicit on-stack plugging (upstream Linux kernel 2.6.39, distributions may have backported). 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, yet others don't feel much effect at all. Minimum 16, default 128, maximum 131072.

cram-hmac-alg

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.

shared-secret

The shared secret used in peer authentication. May be up to 64 characters. Note that peer authentication is disabled as long as no cram-hmac-alg (see above) is specified.

after-sb-0pri policy

possible policies are: disconnect

No automatic resynchronization, simply disconnect.

discard-younger-primary

Auto sync from the node that was primary before the split-brain situation happened.

discard-older-primary

Auto sync from the node that became primary as second during the split-brain situation.

discard-zero-changes

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.

discard-least-changes

Auto sync from the node that touched more blocks during the split brain situation.

discard-node-NODENAME

Auto sync to the named node.

after-sb-1pri policy

possible policies are: disconnect

No automatic resynchronization, simply disconnect.

consensus

Discard the version of the secondary if the outcome of the after-sb-0pri algorithm would also destroy the current secondary's data. Otherwise disconnect.

violently-as0p

Always take the decision of the after-sb-0pri algorithm, even if that causes an erratic change of the primary's view of the data. This is only useful if you use a one-node FS (i.e. not OCFS2 or GFS) with the allow-two-primaries flag, AND if you really know what you are doing. This is DANGEROUS and MAY CRASH YOUR MACHINE if you have an FS mounted on the primary node.

discard-secondary

Discard the secondary's version.

call-pri-lost-after-sb

Always honor the outcome of the after-sb-0pri algorithm. In case it decides the current secondary has the right data, it calls the "pri-lost-after-sb" handler on the current primary.

after-sb-2pri policy

possible policies are: disconnect

No automatic resynchronization, simply disconnect.

violently-as0p

Always take the decision of the after-sb-0pri algorithm, even if that causes an erratic change of the primary's view of the data. This is only useful if you use a one-node FS (i.e. not OCFS2 or GFS) with the allow-two-primaries flag, AND if you really know what you are doing. This is DANGEROUS and MAY CRASH YOUR MACHINE if you have an FS mounted on the primary node.

call-pri-lost-after-sb

Call the "pri-lost-after-sb" helper program on one of the machines. This program is expected to reboot the machine, i.e. make it secondary.

always-asbp

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. 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 led to strange UUID sets.)

rr-conflict policy

This option helps to solve the cases when the outcome of the resync decision is incompatible with the current role assignment in the cluster. disconnect

No automatic resynchronization, simply disconnect.

violently

Sync to the primary node is allowed, violating the assumption that data on a block device are stable for one of the nodes. Dangerous, do not use.

call-pri-lost

Call the pri-lost-after-sb helper program on one of the machines unless that machine can demote to secondary. The helper program is expected to reboot the machine, which brings the node into a secondary role. Which machine runs the helper program is determined by the after-sb-0pri strategy.

data-integrity-alg alg

DRBD can ensure the data integrity of the user's data on the network by comparing hash values. Normally this is ensured by the 16 bit checksums in the headers of TCP/IP packets. This option can be set to any of the kernel's data digest algorithms. In a typical kernel configuration you should have at least one of md5, sha1, and crc32c available. By default this is not enabled.

See also the notes on data integrity.

tcp-cork

DRBD usually uses the TCP socket option TCP_CORK to hint to the network stack when it can expect more data, and when it should flush out what it has in its send queue. It turned out that there is at least one network stack that performs worse when one uses this hinting method. Therefore we introducted this option. By setting tcp-cork to no you can disable the setting and clearing of the TCP_CORK socket option by DRBD.

on-congestion congestion_policy,

congestion-fill fill_threshold,

congestion-extents active_extents_threshold

By default DRBD blocks when the available TCP send queue becomes full. That means it will slow down the application that generates the write requests that cause DRBD to send more data down that TCP connection. When DRBD is deployed with DRBD-proxy it might be more desirable that DRBD goes into AHEAD/BEHIND mode shortly before the send queue becomes full. In AHEAD/BEHIND mode DRBD does no longer replicate data, but still keeps the connection open.

The advantage of the AHEAD/BEHIND mode is that the application is not slowed down, even if DRBD-proxy's buffer is not sufficient to buffer all write requests. The downside is that the peer node falls behind, and that a resync will be necessary to bring it back into sync. During that resync the peer node will have an inconsistent disk.

Available congestion_policys are block and pull-ahead. The default is block. Fill_threshold might be in the range of 0 to 10GiBytes. The default is 0 which disables the check. Active_extents_threshold has the same limits as al-extents.

The AHEAD/BEHIND mode and its settings are available since DRBD 8.3.10.

wfc-timeout time

Wait for connection timeout. The init script drbd(8) blocks the boot process until the DRBD resources are connected. When the cluster manager starts later, it does not see a resource with internal split-brain. In case you want to limit the wait time, do it here. Default is 0, which means unlimited. The unit is seconds.

degr-wfc-timeout time

Wait for connection timeout, if this node was a degraded cluster. In case a degraded cluster (= cluster with only one node left) is rebooted, this timeout value is used instead of wfc-timeout, because the peer is less likely to show up in time, if it had been dead before. Value 0 means unlimited.

outdated-wfc-timeout time

Wait for connection timeout, if the peer was outdated. In case a degraded cluster (= cluster with only one node left) with an outdated peer disk is rebooted, this timeout value is used instead of wfc-timeout, because the peer is not allowed to become primary in the meantime. Value 0 means unlimited.

wait-after-sb

By setting this option you can make the init script to continue to wait even if the device pair had a split brain situation and therefore refuses to connect.

become-primary-on node-name

Sets on which node the device should be promoted to primary role by the init script. The node-name might either be a host name or the keyword both. When this option is not set the devices stay in secondary role on both nodes. Usually one delegates the role assignment to a cluster manager (e.g. heartbeat).

stacked-timeouts

Usually wfc-timeout and degr-wfc-timeout are ignored for stacked devices, instead twice the amount of connect-int is used for the connection timeouts. With the stacked-timeouts keyword you disable this, and force DRBD to mind the wfc-timeout and degr-wfc-timeout statements. Only do that if the peer of the stacked resource is usually not available or will usually not become primary. By using this option incorrectly, you run the risk of causing unexpected split brain.

resync-rate rate

To ensure a smooth operation of the application on top of DRBD, it is possible to limit the bandwidth which may be used by background synchronizations. The default is 250 KB/sec, the default unit is KB/sec. Optional suffixes K, M, G are allowed.

use-rle

During resync-handshake, the dirty-bitmaps of the nodes are exchanged and merged (using bit-or), so the nodes will have the same understanding of which blocks are dirty. On large devices, the fine grained dirty-bitmap can become large as well, and the bitmap exchange can take quite some time on low-bandwidth links.

Because the bitmap typically contains compact areas where all bits are unset (clean) or set (dirty), a simple run-length encoding scheme can considerably reduce the network traffic necessary for the bitmap exchange.

For backward compatibility reasons, and because on fast links this possibly does not improve transfer time but consumes cpu cycles, this defaults to off.

socket-check-timeout value

In setups involving a DRBD-proxy and connections that experience a lot of buffer-bloat it might be necessary to set ping-timeout to an unusual high value. By default DRBD uses the same value to wait if a newly established TCP-connection is stable. Since the DRBD-proxy is usually located in the same data center such a long wait time may hinder DRBD's connect process.

In such setups socket-check-timeout should be set to at least to the round trip time between DRBD and DRBD-proxy. I.e. in most cases to 1.

The default unit is tenths of a second, the default value is 0 (which causes DRBD to use the value of ping-timeout instead). Introduced in 8.4.5.

resync-after res-name

By default, resynchronization of all devices would run in parallel. By defining a resync-after dependency, the resynchronization of this resource will start only if the resource res-name is already in connected state (i.e., has finished its resynchronization).

al-extents extents

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 (= low-level device). 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 extents is 1237. (Minimum: 7, Maximum: 65534)

Note that the effective maximum may be smaller, depending on how you created the device meta data, see also drbdmeta(8). The effective maximum is 919 * (available on-disk activity-log ring-buffer area/4kB -1), the default 32kB ring-buffer effects a maximum of 6433 (covers more than 25 GiB of data). We recommend to keep this well within the amount your backend storage and replication link are able to resync inside of about 5 minutes.

al-updates {yes | no}

DRBD's activity log transaction writing makes it possible, that after the crash of a primary node a partial (bit-map based) resync is sufficient to bring the node back to up-to-date. Setting al-updates to no might increase normal operation performance but causes DRBD to do a full resync when a crashed primary gets reconnected. The default value is yes.

verify-alg hash-alg

During online verification (as initiated by the verify sub-command), rather than doing a bit-wise comparison, DRBD applies a hash function to the contents of every block being verified, and compares that hash with the peer. This option defines the hash algorithm being used for that purpose. It can be set to any of the kernel's data digest algorithms. In a typical kernel configuration you should have at least one of md5, sha1, and crc32c available. By default this is not enabled; you must set this option explicitly in order to be able to use on-line device verification. See also the notes on data integrity.

csums-alg hash-alg

A resync process sends all marked data blocks from the source to the destination node, as long as no csums-alg is given. When one is specified the resync process exchanges hash values of all marked blocks first, and sends only those data blocks that have different hash values. This setting is useful for DRBD setups with low bandwidth links. During the restart of a crashed primary node, all blocks covered by the activity log are marked for resync. But a large part of those will actually be still in sync, therefore using csums-alg will lower the required bandwidth in exchange for CPU cycles.

c-plan-ahead plan_time,

c-fill-target fill_target,

c-delay-target delay_target,

c-max-rate max_rate

The dynamic resync speed controller gets enabled with setting plan_time to a positive value. It aims to fill the buffers along the data path with either a constant amount of data fill_target, or aims to have a constant delay time of delay_target along the path. The controller has an upper bound of max_rate. By plan_time the agility of the controller is configured. Higher values yield for slower/lower responses of the controller to deviation from the target value. It should be at least 5 times RTT. For regular data paths a fill_target in the area of 4k to 100k is appropriate. For a setup that contains drbd-proxy it is advisable to use delay_target instead. Only when fill_target is set to 0 the controller will use delay_target. 5 times RTT is a reasonable starting value. Max_rate should be set to the bandwidth available between the DRBD-hosts and the machines hosting DRBD-proxy, or to the available disk-bandwidth.

The default value of plan_time is 0, the default unit is 0.1 seconds. Fill_target has 0 and sectors as default unit. Delay_target has 1 (100ms) and 0.1 as default unit. Max_rate has 10240 (100MiB/s) and KiB/s as default unit.

The dynamic resync speed controller and its settings are available since DRBD 8.3.9.

c-min-rate min_rate

A node that is primary and sync-source has to schedule application IO requests and resync IO requests. The min_rate tells DRBD use only up to min_rate for resync IO and to dedicate all other available IO bandwidth to application requests. Note: The value 0 has a special meaning. It disables the limitation of resync IO completely, which might slow down application IO considerably. Set it to a value of 1, if you prefer that resync IO never slows down application IO.

Note: Although the name might suggest that it is a lower bound for the dynamic resync speed controller, it is not. If the DRBD-proxy buffer is full, the dynamic resync speed controller is free to lower the resync speed down to 0, completely independent of the c-min-rate setting.

The default value of min_rate is 250, in units of KiB/s

on-no-data-accessible ond-policy

This setting controls what happens to IO requests on a degraded, disk less node (I.e. no data store is reachable). The available policies are io-error and suspend-io. If ond-policy is set to suspend-io you can either resume IO by attaching/connecting the last lost data storage, or by the drbdadm resume-io res command. The latter will result in IO errors of course.

The default is io-error. This setting is available since DRBD 8.3.9.

cpu-mask cpu-mask

Sets the cpu-affinity-mask for DRBD's kernel threads of this device. The default value of cpu-mask is 0, which means that DRBD's kernel threads should be spread over all CPUs of the machine. This value must be given in hexadecimal notation. If it is too big it will be truncated.

pri-on-incon-degr cmd

This handler is called if the node is primary, degraded and if the local copy of the data is inconsistent.

pri-lost-after-sb cmd

The node is currently primary, but lost the after-split-brain auto recovery procedure. As as consequence, it should be abandoned.

pri-lost cmd

The node is currently primary, but DRBD's algorithm thinks that it should become sync target. As a consequence it should give up its primary role.

fence-peer cmd

The handler is part of the fencing mechanism. This handler is called in case the node needs to fence the peer's disk. It should use other communication paths than DRBD's network link.

local-io-error cmd

DRBD got an IO error from the local IO subsystem.

initial-split-brain cmd

DRBD has connected and detected a split brain situation. This handler can alert someone in all cases of split brain, not just those that go unresolved.

split-brain cmd

DRBD detected a split brain situation but remains unresolved. Manual recovery is necessary. This handler should alert someone on duty.

before-resync-target cmd

DRBD calls this handler just before a resync begins on the node that becomes resync target. It might be used to take a snapshot of the backing block device.

after-resync-target cmd

DRBD calls this handler just after a resync operation finished on the node whose disk just became consistent after being inconsistent for the duration of the resync. It might be used to remove a snapshot of the backing device that was created by the before-resync-target handler.

### Other Keywords
include file-pattern

Include all files matching the wildcard pattern file-pattern. The include statement is only allowed on the top level, i.e. it is not allowed inside any section.

## NOTES ON DATA INTEGRITY
There are two independent methods in DRBD to ensure the integrity of the mirrored data. The online-verify mechanism and the data-integrity-alg of the network section.

Both mechanisms might deliver false positives if the user of DRBD modifies the data which gets written to disk while the transfer goes on. This may happen for swap, or for certain append while global sync, or truncate/rewrite workloads, and not necessarily poses a problem for the integrity of the data. Usually when the initiator of the data transfer does this, it already knows that that data block will not be part of an on disk data structure, or will be resubmitted with correct data soon enough.

The data-integrity-alg causes the receiving side to log an error about "Digest integrity check FAILED: Ns +x\n", where N is the sector offset, and x is the size of the request in bytes. It will then disconnect, and reconnect, thus causing a quick resync. If the sending side at the same time detected a modification, it warns about "Digest mismatch, buffer modified by upper layers during write: Ns +x\n", which shows that this was a false positive. The sending side may detect these buffer modifications immediately after the unmodified data has been copied to the tcp buffers, in which case the receiving side won't notice it.

The most recent (2007) example of systematic corruption was an issue with the TCP offloading engine and the driver of a certain type of GBit NIC. The actual corruption happened on the DMA transfer from core memory to the card. Since the TCP checksum gets calculated on the card, this type of corruption stays undetected as long as you do not use either the online verify or the data-integrity-alg.

We suggest to use the data-integrity-alg only during a pre-production phase due to its CPU costs. Further we suggest to do online verify runs regularly e.g. once a month during a low load period.

## VERSION
This document was revised for version 8.4.0 of the DRBD distribution.

## AUTHOR
Written by Philipp Reisner <philipp.reisner@linbit.com> and Lars Ellenberg <lars.ellenberg@linbit.com>.

## REPORTING BUGS
Report bugs to <drbd-user@lists.linbit.com>.

## COPYRIGHT
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.

## SEE ALSO
drbd(8), drbdsetup(8), drbdmeta(8), drbdadm(8), DRBD User's Guide[1], DRBD web site[3]

## NOTES
1.

DRBD User's Guide

http://www.drbd.org/users-guide/

2.

DRBD's online usage counter

http://usage.drbd.org

3.

DRBD web site

http://www.drbd.org/