...
A resource specified by name, or the keyword all for all defined resources.
device
A device, specified by minor number (minor- minornumber, e.g. minor-0) or by resource and volume number ( resource/volume). If only a resource is specified, the command iterates over all devices of that resource.
connection
A connection, specified by resource and connection name ( resource:connection-name). If only a resource is specified, the command iterates over all connections of that resource.
peer_device
A peer device, specified by resource, connection name, and volume number ( resource:connection-name/volume). If only a resource, device, or connection is specified, the command iterates over all peer devices of that resource, device, or connection.
...
Activate an exisiting connection to a peer. The connection needs to be created first with the new-peer command, and have at least one path created with the new-path command. See drbdsetup(8) for details.
create-md { device}
Initialize the metadata of a device. This is necessary before a device can be attached; see drbdmeta(8) for details.
cstate { connection}
Show the current state of a connection. See drbdsetup(8) for details.
detach { device}
Detach the lower-level device of a replicated device. See drbdsetup(8) for details.
disconnect { connection}
Remove a connection to a peer host. See drbdsetup(8) for details.
disk-options { device}
Change the disk options of an attached lower-level device. See drbdsetup(8) for details.
down { resource}
Take a resource down by removing all volumes, connections, and the resource itself. See drbdsetup(8) for details.
dstate { device}
Show the current disk state of a lower-level device. See drbdsetup(8) for details.
dump { resource}
...
Dump the metadata of a device in text form, including the bitmap and activity log. See drbdmeta(8) for details.
get-gi { peer_device}
Show the data generation identifiers for a device on a particular connection. Uses drbdsetup for attached devices and drbdmeta for unattached devices. See drbdsetup(8) for details.
hidden-commands
...
Replace the local data of a device with that of a peer. See drbdsetup(8) for details.
invalidate-remote { peer_device}
Replace a peer device's data of a resource with the local data. See drbdsetup(8) for details.
net-options { connection}
Change the network options of an existing connection. See drbdsetup(8) for details.
new-current-uuid { device}
Generate a new currend UUID. See drbdsetup(8) for details.
outdate { device}
Mark the data on a lower-level device as outdated. See drbdsetup(8) for details.
pause-sync { peer_device}
Stop resynchronizing between a local and a peer device by setting the local pause flag. See drbdsetup(8) for details.
primary { resource}
Change the role of a node in a resource to primary. See drbdsetup(8) for details.
resize { device}
Resize the lower-level devices of a replicated device on all nodes. This combines the check-resize and resize lower-level commands; see drbdsetup(8) for details.
resource-options { resource}
Change the resource options of an existing resource. See drbdsetup(8) for details.
resume-sync { peer_device}
Allow resynchronization to resume by clearing the local sync pause flag. See drbdsetup(8) for details.
role { resource}
...
Show the data generation identifiers for a device on a particular connection. In addition, explain the output. See drbdsetup(8) for details.
state { resource}
...
Start online verification, change which part of the device will be verified, or stop online verification. See drbdsetup(8) for details.
wait-connect {[ device] | [connection] | [resource]}
Wait until a device on a peer, all devices over a connection, or all devices on all peers are visible. See drbdsetup(8) for details.
wait-sync {[ device] | [connection] | [resource]}
Wait until a device is connected and has finished eventual resync operation. Also available on connection and resource level. See drbdsetup(8) for details.
wipe-md { device}
Wipe out the DRBD metadata of a device. See drbdmeta(8) for details.
forget-peer { connection}
Completely remove any reference to a unconnected peer from meta-data. See drbdmeta(8) for details.
bsrsetup
drbdsetup command {argument...} [option...]
DESCRIPTION
The drbdsetup utility serves to configure the DRBD kernel module and to show its current configuration. Users usually interact with the drbdadm utility, which provides a more high-level interface to DRBD than drbdsetup. (See drbdadm's --dry-run option to see how drbdadm uses drbdsetup.)Some option arguments have a default scale which applies when a plain number is specified (for example Kilo, or 1024 times the numeric value). Such default scales can be overridden by using a suffix (for example, M for Mega). The common suffixes K = 2^10 = 1024, M = 1024 K, and G = 1024 M are supported.
COMMANDS
drbdsetup attach minor lower_dev meta_data_dev meta_data_index,
drbdsetup disk-options minor
The attach command attaches a lower-level device to an existing replicated device. The disk-options command changes the disk options of an attached lower-level device. In either case, the replicated device must have been created with drbdsetup new-minor.
...
--al-extents extents DRBD automatically maintains a "hot" or "active" disk area likely to be written to again soon based on the recent write activity. The "active" disk area can be written to immediately, while "inactive" disk areas must be "activated" first, which requires a meta-data write. We also refer to this active disk area as the "activity log". The activity log saves meta-data writes, but the whole log must be resynced upon recovery of a failed node. The size of the activity log is a major factor of how long a resync will take and how fast a replicated disk will become consistent after a crash. The activity log consists of a number of 4-Megabyte segments; the al-extents parameter determines how many of those segments can be active at the same time. The default value for al-extents is 1237, with a minimum of 7 and a maximum of 65536. 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.
...
--rs-discard-granularity byteWhen 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 is 0. This option is available since 8.4.7.
drbdsetup peer-device-options resource peer_node_id volume
...
--resync-rate rate Define how much bandwidth DRBD may use for resynchronizing. DRBD allows "normal" application I/O even during a resync. If the resync takes up too much bandwidth, application I/O can become very slow. This parameter allows to avoid that. Please note this is option only works when the dynamic resync controller is disabled.
drbdsetup check-resize minor
Remember the current size of the lower-level device of the specified replicated device. Used by drbdadm. The size information is stored in file /var/lib/drbd/drbd-minor- minor.lkbd.
drbdsetup new-peer resource peer_node_id,
drbdsetup net-options resource peer_node_id
...
--verify-alg hash-algorithm Online verification (drbdadm verify) computes and compares checksums of disk blocks (i.e., hash values) in order to detect if they differ. The verify-alg parameter determines which algorithm to use for these checksums. It must be set to one of the secure hash algorithms supported by the kernel before online verify can be used; see the shash algorithms listed in /proc/crypto. We recommend to schedule online verifications regularly during low-load periods, for example once a month. Also see the notes on data integrity below.
drbdsetup new-path resource peer_node_id local-addr remote-addr
The new-path command creates a path within a connection. The connection must have been created with drbdsetup new-peer. Local_addr and remote_addr refer to the local and remote protocol, network address, and port in the format [ address-family:] address[:port]. The address families ipv4, ipv6, ssocks (Dolphin Interconnect Solutions' "super sockets"), sdp (Infiniband Sockets Direct Protocol), and sci are supported ( sci is an alias for ssocks). If no address family is specified, ipv4 is assumed. For all address families except ipv6, the address uses IPv4 address notation (for example, 1.2.3.4). For ipv6, the address is enclosed in brackets and uses IPv6 address notation (for example, [fd01:2345:6789:abcd::1]). The port defaults to 7788.
drbdsetup connect resource peer_node_id
...
--discard-my-data Discard the local data and resynchronize with the peer that has the most up-to-data data. Use this option to manually recover from a split-brain situation.
drbdsetup del-peer resource peer_node_id
The del-peer command removes a connection from a resource.
drbdsetup del-path resource peer_node_id local-addr remote-addr
The del-path command removes a path from a connection. Please note that it fails if the path is necessary to keep a connected connection in tact. In order to remove all paths, disconnect the connection first.
drbdsetup cstate resource peer_node_id
Show the current state of a connection. The connection is identified by the node-id of the peer; see the drbdsetup connect command.
drbdsetup del-minor minor
Remove a replicated device. No lower-level device may be attached; see drbdsetup detach.
drbdsetup del-resource resource
Remove a resource. All volumes and connections must be removed first ( drbdsetup del-minor, drbdsetup disconnect). Alternatively, drbdsetup down can be used to remove a resource together with all its volumes and connections.
drbdsetup detach minor
Detach the lower-level device of a replicated device. Available options:
--force Force the detach and return immediately. This puts the lower-level device into failed state until all pending I/O has completed, and then detaches the device. Any I/O not yet submitted to the lower-level device (for example, because I/O on the device was suspended) is assumed to have failed.
drbdsetup disconnect resource peer_node_id
Remove a connection to a peer host. The connection is identified by the node-id of the peer; see the drbdsetup connect command.
drbdsetup down {resource | all}
Take a resource down by removing all volumes, connections, and the resource itself.
drbdsetup dstate minor
Show the current disk state of a lower-level device.
drbdsetup events2 {resource | all}
...
--statistics Include statistics in the output.
drbdsetup get-gi resource peer_node_id volume
Show the data generation identifiers for a device on a particular connection. The device is identified by its volume number. The connection is identified by its endpoints; see the drbdsetup connect command. The output consists of the current UUID, bitmap UUID, and the first two history UUIDS, folowed by a set of flags. The current UUID and history UUIDs are device specific; the bitmap UUID and flags are peer device specific. This command only shows the first two history UUIDs. Internally, DRBD maintains one history UUID for each possible peer device.
drbdsetup invalidate minor
Replace the local data of a device with that of a peer. All the local data will be marked out-of-sync, and a resync with the specified peer device will be initialted.
drbdsetup invalidate-remote resource peer_node_id volume
Replace a peer device's data of a resource with the local data. The peer device's data will be marked out-of-sync, and a resync from the local node to the specified peer will be initiated.
drbdsetup new-current-uuid minor
Generate a new current UUID and rotates all other UUID values. This has at least two use cases, namely to skip the initial sync, and to reduce network bandwidth when starting in a single node configuration and then later (re-)integrating a remote site. Available option:
--clear-bitmap Clears the sync bitmap in addition to generating a new current UUID. This can be used to skip the initial sync, if you want to start from scratch. This use-case does only work on "Just Created" meta data.
drbdsetup new-minor resource minor volume
Create a new replicated device within a resource. The command creates a block device inode for the replicated device (by default, /dev/drbd minor). The volume number identifies the device within the resource.
drbdsetup new-resource resource node_id,
drbdsetup resource-options resource
...
--peer-ack-delay expiry-time If after the last finished write request no new write request gets issued for expiry-time, then a peer-ack packet is sent. If a new write request is issued before the timer expires, the timer gets reset to expiry-time. (Note: peer-ack packets may be sent due to other reasons as well, e.g. membership changes or the peer-ack-window option.) This parameter may influence resync behavior on remote nodes. Peer nodes need to wait until they receive an peer-ack for releasing a lock on an AL-extent. Resync operations between peers may need to wait for for these locks. The default value for peer-ack-delay is 100 milliseconds, the default unit is milliseconds. This option is available since 9.0.0.
drbdsetup outdate minor
Mark the data on a lower-level device as outdated. This is used for fencing, and prevents the resource the device is part of from becoming primary in the future. See the --fencing disk option.
drbdsetup pause-sync resource peer_node_id volume
Stop resynchronizing between a local and a peer device by setting the local pause flag. The resync can only resume if the pause flags on both sides of a connection are cleared.
drbdsetup primary resource
Change the role of a node in a resource to primary. This allows the replicated devices in this resource to be mounted or opened for writing. Available options:
...
--force Force the resource to become primary even if some devices are not guaranteed to have up-to-date data. This option is used to turn one of the nodes in a newly created cluster into the primary node, or when manually recovering from a disaster. Note that this can lead to split-brain scenarios. Also, when forcefully turning an inconsistent device into an up-to-date device, it is highly recommended to use any integrity checks available (such as a filesystem check) to make sure that the device can at least be used without crashing the system. Note that DRBD usually only allows one node in a cluster to be in primary role at any time; this allows DRBD to coordinate access to the devices in a resource across nodes. The --allow-two-primaries network option changes this; in that case, a mechanism outside of DRBD needs to coordinate device access.
drbdsetup resize minor
Reexamine the size of the lower-level devices of a replicated device on all nodes. This command is called after the lower-level devices on all nodes have been grown to adjust the size of the replicated device. Available options:
...
--al-stripes val These options may be used to change the layout of the activity log online. In case of internal meta data this may invovle shrinking the user visible size at the same time (unsing the --size) or increasing the avalable space on the backing devices.
drbdsetup resume-io minor
Resume I/O on a replicated device. See the --fencing net option.
drbdsetup resume-sync resource peer_node_id volume
Allow resynchronization to resume by clearing the local sync pause flag.
drbdsetup role resource
Show the current role of a resource.
drbdsetup secondary resource
Change the role of a node in a resource to secondary. This command fails if the replicated device is in use.
drbdsetup show {resource | all}
Show the current configuration of a resource, or of all resources. Available options:
--show-defaults Show all configuration parameters, even the ones with default values. Normally, parameters with default values are not shown.
drbdsetup show-gi resource peer_node_id volume
Show the data generation identifiers for a device on a particular connection. In addition, explain the output. The output otherwise is the same as in the drbdsetup get-gi command.
drbdsetup state
This is an alias for drbdsetup role. Deprecated.
drbdsetup status {resource | all}
Show the status of a resource, or of all resources. The output consists of one paragraph for each configured resource. Each paragraph contains one line for each resource, followed by one line for each device, and one line for each connection. The device and connection lines are indented. The connection lines are followed by one line for each peer device; these lines are indented against the connection line. Long lines are wrapped around at terminal width, and indented to indicate how the lines belongs together. Available options:
...
--color={always | auto | never} Colorize the output. With --color=auto, drbdsetup emits color codes only when standard output is connected to a terminal.
...
Code Block |
---|
drbd0 node-id:1 role:Primary suspended:no volume:0 minor:1 disk:UpToDate blocked:no host2.example.com local:ipv4:192.168.123.4:7788 peer:ipv4:192.168.123.2:7788 node-id:0 connection:WFReportParams role:Secondary congested:no volume:0 replication:Connected disk:UpToDate resync-suspended:no |
drbdsetup suspend-io minor
Suspend I/O on a replicated device. It is not usually necessary to use this command.
drbdsetup verify resource peer_node_id volume
...
--stop position Define where online verification should stop. If online verification is already in progress, the stop position of the active online verification process is changed. Use this to stop online verification. The position on disk is specified in disk sectors (512 bytes) by default. Also see the notes on data integrity in the drbd.conf(5) manual page.
drbdsetup wait-connect-volume resource peer_node_id volume,
drbdsetup wait-connect-connection resource peer_node_id,
drbdsetup wait-connect-resource resource,
drbdsetup wait-sync-volume resource peer_node_id volume,
drbdsetup wait-sync-connection resource peer_node_id,
drbdsetup wait-sync-resource resource
...
--wfc-timeout timeout Define how long the init script waits until all peers are connected. This can be useful in combination with a cluster manager which cannot manage DRBD resources: when the cluster manager starts, the DRBD resources will already be up and running. With a more capable cluster manager such as Pacemaker, it makes more sense to let the cluster manager control DRBD resources. The timeout is specified in seconds. The default value is 0, which stands for an infinite timeout. Also see the degr-wfc-timeout parameter.
drbdsetup forget-peer resource peer_node_id
The forget-peer command removes all traces of a peer node from the meta-data. It frees a bitmap slot in the meta-data and make it avalable for futher bitmap slot allocation in case a so-far never seen node connects. The connection must be taken down before this command may be used. In case the peer re-connects at a later point a bit-map based resync will be turned into a full-sync.
bsrmeta
drbdmeta [--force] [--ignore-sanity-checks] { device} {v06 minor | v07 meta_dev index | v08 meta_dev index | v09 meta_dev index} { command} [cmd args...]
DESCRIPTION
The drbdmeta utility is used for creating, displaying, and modifying DRBD's on-disk metadata. Users usually interact with the drbdadm utility, which provides a more high-level interface to DRBD than drbdmeta. (See drbdadm's --dry-run option to see how drbdadm uses drbdmeta.)This utility can only be used on devices which are not currently in use by the kernel.The first argument ( device) specifies the drbd device associated with a volume, or “-” if no device is associated with that volume. If the drbd device is specified, the drbdmeta utility makes sure that the drbd device does not currently have a volume attached to prevent meta-data of an active volume from being destroyed.The second argument specifies the metadata version to use (v06, v07, v08, v09). In most metadata versions, the third argument ( meta_dev) specifies the device which contains the metadata; this argument can be the same as device. The fourth argument ( index) can be one of the keywords internal (for internal metadata), flex-internal (in v07 for variable-sized metadata; v07 otherwise defaults to fixed-size internal metadata), flex-external (for variable-sized external metadata), or a numeric matadata index (for fixed-size external metadata). See the meta-disk parameter in drbd.conf(5).
OPTIONS
--force
Assume yes as the answer to all questions drbdmeta would ask.
--ignore-sanity-checks
Normally, drbdmeta performs some sanity checks before writing to the metadata device: for example, if the device appears to contain a file system, it refuses to destroy the file system by writing into it. Use this option to ignore these checks.
...
Initialize the metadata. This is necessary before a DRBD resource can be attached. If drbdmeta finds an older version of DRBD metadata on the device, it asks if the format should be converted. When drbdadm calls drbdmeta's create-md command for a device, it sets the number-of-bitmap-slots argument to the number of peers in the resource. To reserve additional bitmap slots (which allows to add more peers in the future), call drbdmeta directly instead. When a device is used before being connected to its peers the first time, DRBD assumes that peers can only handle 4 KiB requests by default. The --peer-max-bio-size option allows to set more optimistic values; use this if the versions of DRBD that this device will connect to are known. DRBD supports a maximum bio size of 32 KiB since version 8.3.8, of 128 KiB since version 8.3.9, and of 1 MiB since version 8.4.0. If you want to use more than 6433 activity log extents, or live on top of a spriped RAID, you may specify the number of stripes ( --al-stripes, default 1), and the stripe size ( --al-stripe-size-kB, default 32). To just use a larger linear on-disk ring-buffer, leave the number of stripes at 1, and increase the size only:
...
Mark the data on a lower-level device as outdated. See drbdsetup(8) for details.
dstate
Show the current disk state of a lower-level device.
...
Apply the activity log of the specified device. This is necessary before the device can be attached by the kernel again.
EXPERT COMMANDS
The drbdmeta utility can be used to fine tune metdata. Please note that this can lead to destroyed metadata or even silent data corruption; use with great care only.
...
Replace the metadata on the device with the contents of dump_file. The dump file format is defined by the output of the dump-md command.