This guide describes DRBD version 8.4 and above. For 8.3 please look here.


Chapter 6. Common administrative tasks

Table of Contents

6.1. Checking DRBD status
6.1.1. Retrieving status with drbd-overview
6.1.2. Status information in /proc/drbd
6.1.3. Connection states
6.1.4. Resource roles
6.1.5. Disk states
6.1.6. I/O state flags
6.1.7. Performance indicators
6.2. Enabling and disabling resources
6.2.1. Enabling resources
6.2.2. Disabling resources
6.3. Reconfiguring resources
6.4. Promoting and demoting resources
6.5. Basic Manual Fail-over
6.6. Upgrading DRBD
6.6.1. Updating your repository
6.6.2. Upgrading the packages
6.6.3. Migrating your configs
6.7. Downgrading DRBD 8.4 to 8.3
6.8. Enabling dual-primary mode
6.8.1. Permanent dual-primary mode
6.8.2. Temporary dual-primary mode
6.8.3. Automating promotion on system startup
6.9. Using on-line device verification
6.9.1. Enabling on-line verification
6.9.2. Invoking on-line verification
6.9.3. Automating on-line verification
6.10. Configuring the rate of synchronization
6.10.1. Permanent fixed sync rate configuration
6.10.2. Temporary fixed sync rate configuration
6.10.3. Variable sync rate configuration
6.11. Configuring checksum-based synchronization
6.12. Configuring congestion policies and suspended replication
6.13. Configuring I/O error handling strategies
6.14. Configuring replication traffic integrity checking
6.15. Resizing resources
6.15.1. Growing on-line
6.15.2. Growing off-line
6.15.3. Shrinking on-line
6.15.4. Shrinking off-line
6.16. Disabling backing device flushes
6.17. Configuring split brain behavior
6.17.1. Split brain notification
6.17.2. Automatic split brain recovery policies
6.18. Creating a three-node setup
6.18.1. Device stacking considerations
6.18.2. Configuring a stacked resource
6.18.3. Enabling stacked resources
6.19. Using DRBD Proxy
6.19.1. DRBD Proxy deployment considerations
6.19.2. Installation
6.19.3. License file
6.19.4. Configuration
6.19.5. Controlling DRBD Proxy
6.19.6. About DRBD Proxy plugins
6.19.7. Using a WAN Side Bandwidth Limit
6.19.8. Troubleshooting

This chapter outlines typical administrative tasks encountered during day-to-day operations. It does not cover troubleshooting tasks, these are covered in detail in Chapter 7, Troubleshooting and error recovery.

6.1. Checking DRBD status

6.1.1. Retrieving status with drbd-overview

The most convenient way to look at DRBD’s status is the drbd-overview utility.

# drbd-overview
0:home                 Connected Primary/Secondary
  UpToDate/UpToDate C r--- /home        xfs  200G 158G 43G  79%
1:data                 Connected Primary/Secondary
  UpToDate/UpToDate C r--- /mnt/ha1     ext3 9.9G 618M 8.8G 7%
2:nfs-root             Connected Primary/Secondary
  UpToDate/UpToDate C r--- /mnt/netboot ext3 79G  57G  19G  76%

6.1.2. Status information in /proc/drbd

/proc/drbd is a virtual file displaying real-time status information about all DRBD resources currently configured. You may interrogate this file’s contents using this command:

$ cat /proc/drbd
version: 8.4.0 (api:1/proto:86-100)
GIT-hash: 09b6d528b3b3de50462cd7831c0a3791abc665c3 build by linbit@buildsystem.linbit, 2011-10-12 09:07:35
 0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-----
    ns:0 nr:0 dw:0 dr:656 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0
 1: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r---
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0
 2: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r---
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0

The first line, prefixed with version:, shows the DRBD version used on your system. The second line contains information about this specific build.

The other four lines in this example form a block that is repeated for every DRBD device configured, prefixed by the device minor number. In this case, this is 0, corresponding to the device /dev/drbd0.

The resource-specific output from /proc/drbd contains various pieces of information about the resource:

cs (connection state). Status of the network connection. See Section 6.1.3, “Connection states”for details about the various connection states.

ro (roles). Roles of the nodes. The role of the local node is displayed first, followed by the role of the partner node shown after the slash. See Section 6.1.4, “Resource roles”for details about the possible resource roles.

ds (disk states). State of the hard disks. Prior to the slash the state of the local node is displayed, after the slash the state of the hard disk of the partner node is shown. See Section 6.1.5, “Disk states”for details about the various disk states.

Replication protocol. Replication protocol used by the resource. Either A, B or C. See Section 2.3, “Replication modes” for details.

I/O Flags. Six state flags reflecting the I/O status of this resource. See Section 6.1.6, “I/O state flags” for a detailed explanation of these flags.

Performance indicators. A number of counters and gauges reflecting the resource’s utilization and performance. See Section 6.1.7, “Performance indicators” for details.

6.1.3. Connection states

A resource’s connection state can be observed either by monitoring /proc/drbd, or by issuing the drbdadm cstate command:

# drbdadm cstate <resource>
Connected

A resource may have one of the following connection states:

StandAloneNo network configuration available. The resource has not yet been connected, or has been administratively disconnected (using drbdadm disconnect), or has dropped its connection due to failed authentication or split brain.

DisconnectingTemporary state during disconnection. The next state is StandAlone.

UnconnectedTemporary state, prior to a connection attempt. Possible next states: WFConnection and WFReportParams.

TimeoutTemporary state following a timeout in the communication with the peer. Next state: Unconnected.

BrokenPipeTemporary state after the connection to the peer was lost. Next state: Unconnected.

NetworkFailureTemporary state after the connection to the partner was lost. Next state: Unconnected.

ProtocolErrorTemporary state after the connection to the partner was lost. Next state: Unconnected.

TearDownTemporary state. The peer is closing the connection. Next state: Unconnected.

WFConnectionThis node is waiting until the peer node becomes visible on the network.

WFReportParamsTCP connection has been established, this node waits for the first network packet from the peer.

ConnectedA DRBD connection has been established, data mirroring is now active. This is the normal state.

StartingSyncSFull synchronization, initiated by the administrator, is just starting. The next possible states are: SyncSource or PausedSyncS.

StartingSyncTFull synchronization, initiated by the administrator, is just starting. Next state: WFSyncUUID.

WFBitMapSPartial synchronization is just starting. Next possible states: SyncSource or PausedSyncS.

WFBitMapTPartial synchronization is just starting. Next possible state: WFSyncUUID.

WFSyncUUIDSynchronization is about to begin. Next possible states: SyncTarget or PausedSyncT.

SyncSourceSynchronization is currently running, with the local node being the source of synchronization.

SyncTargetSynchronization is currently running, with the local node being the target of synchronization.

PausedSyncSThe local node is the source of an ongoing synchronization, but synchronization is currently paused. This may be due to a dependency on the completion of another synchronization process, or due to synchronization having been manually interrupted by drbdadm pause-sync.

PausedSyncTThe local node is the target of an ongoing synchronization, but synchronization is currently paused. This may be due to a dependency on the completion of another synchronization process, or due to synchronization having been manually interrupted by drbdadm pause-sync.

VerifySOn-line device verification is currently running, with the local node being the source of verification.

VerifyTOn-line device verification is currently running, with the local node being the target of verification.

6.1.4. Resource roles

A resource’s role can be observed either by monitoring /proc/drbd, or by issuing the drbdadm role command:

# drbdadm role <resource>
Primary/Secondary

The local resource role is always displayed first, the remote resource role last.

You may see one of the following resource roles:

PrimaryThe resource is currently in the primary role, and may be read from and written to. This role only occurs on one of the two nodes, unless dual-primary mode is enabled.

SecondaryThe resource is currently in the secondary role. It normally receives updates from its peer (unless running in disconnected mode), but may neither be read from nor written to. This role may occur on one or both nodes.

UnknownThe resource’s role is currently unknown. The local resource role never has this status. It is only displayed for the peer’s resource role, and only in disconnected mode.

6.1.5. Disk states

A resource’s disk state can be observed either by monitoring /proc/drbd, or by issuing the drbdadm dstate command:

# drbdadm dstate <resource>
UpToDate/UpToDate

The local disk state is always displayed first, the remote disk state last.

Both the local and the remote disk state may be one of the following:

DisklessNo local block device has been assigned to the DRBD driver. This may mean that the resource has never attached to its backing device, that it has been manually detached using drbdadm detach, or that it automatically detached after a lower-level I/O error.

AttachingTransient state while reading meta data.

FailedTransient state following an I/O failure report by the local block device. Next state: Diskless.

NegotiatingTransient state when an Attach is carried out on an already-Connected DRBD device.

InconsistentThe data is inconsistent. This status occurs immediately upon creation of a new resource, on both nodes (before the initial full sync). Also, this status is found in one node (the synchronization target) during synchronization.

OutdatedResource data is consistent, but outdated.

DUnknownThis state is used for the peer disk if no network connection is available.

ConsistentConsistent data of a node without connection. When the connection is established, it is decided whether the data is UpToDate or Outdated.

UpToDateConsistent, up-to-date state of the data. This is the normal state.

6.1.6. I/O state flags

The I/O state flag field in /proc/drbd contains information about the current state of I/O operations associated with the resource. There are six such flags in total, with the following possible values:

  1. I/O suspension. Either r for running or s for suspended I/O. Normally r.
  2. Serial resynchronization. When a resource is awaiting resynchronization, but has deferred this because of a resync-after dependency, this flag becomes a. Normally -.
  3. Peer-initiated sync suspension. When resource is awaiting resynchronization, but the peer node has suspended it for any reason, this flag becomes p. Normally -.
  4. Locally initiated sync suspension. When resource is awaiting resynchronization, but a user on the local node has suspended it, this flag becomes u. Normally -.
  5. Locally blocked I/O. Normally -. May be one of the following flags:

    • d: I/O blocked for a reason internal to DRBD, such as a transient disk state.
    • b: Backing device I/O is blocking.
    • n: Congestion on the network socket.
    • a: Simultaneous combination of blocking device I/O and network congestion.
  6. Activity Log update suspension. When updates to the Activity Log are suspended, this flag becomes s. Normally -.

6.1.7. Performance indicators

The second line of /proc/drbd information for each resource contains the following counters and gauges:

ns (network send). Volume of net data sent to the partner via the network connection; in Kibyte.

nr (network receive). Volume of net data received by the partner via the network connection; in Kibyte.

dw (disk write). Net data written on local hard disk; in Kibyte.

dr (disk read). Net data read from local hard disk; in Kibyte.

al (activity log). Number of updates of the activity log area of the meta data.

bm (bit map). Number of updates of the bitmap area of the meta data.

lo (local count). Number of open requests to the local I/O sub-system issued by DRBD.

pe (pending). Number of requests sent to the partner, but that have not yet been answered by the latter.

ua (unacknowledged). Number of requests received by the partner via the network connection, but that have not yet been answered.

ap (application pending). Number of block I/O requests forwarded to DRBD, but not yet answered by DRBD.

ep (epochs). Number of epoch objects. Usually 1. Might increase under I/O load when using either the barrier or the none write ordering method.

wo (write order). Currently used write ordering method: b(barrier), f(flush), d(drain) or n(none).

oos (out of sync). Amount of storage currently out of sync; in Kibibytes.


This guide describes DRBD version 8.4 and above. For 8.3 please look here.