DRBDADM(8)

πŸ‘‘ DRBDADM πŸ’… β€” the drbdadm(8) page, bestie edition

okay so welcome to drbdadm, section 8 of the manual, filed under System Administration. yes it's a whole vibe, yes it's important, let's get into it 🫢

✨ NAME ✨

drbdadm β€” the utility for DRBD administration, aka your new bestie for wrangling DRBD πŸ’–


🌸 SYNOPSIS 🌸

drbdadm [options...] [-- [backend-options...]] {command} {context...}

πŸ¦‹ DESCRIPTION πŸ¦‹

so drbdadm is the utility you use to manage DRBD based on its config files (peep drbd.conf(5) for those). what it actually does is translate high-level commands into one or more lower-level commands for the drbdsetup and drbdmeta utilities β€” and those two are the ones actually controlling the kernel module and manipulating the on-disk metadata. so drbdadm is like the group chat admin, and drbdsetup/drbdmeta are the ones doing the work. team effort, no cap πŸ’…

depending on which command you run, drbdadm operates on one or more resources, devices, connections, or peer devices. here are the command contexts that are defined:

  • resource β€” 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 you only specify a resource, the command iterates over all devices of that resource. ✨
  • connection β€” a connection, specified by resource and connection name (resource:connection-name). if you only specify a resource, 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 you only specify a resource, device, or connection, the command iterates over all peer devices of that resource, device, or connection.

and here's the lil trick you need to know: every option that comes after a double-dash gets passed straight through to the lower-level utilities, exactly as specified. plus, drbdadm understands most of the options of drbdsetup too, and will pass those through even without the double-dash. iykyk 😌


πŸŽ€ OPTIONS πŸŽ€

  • -d, --dry-run β€” show which commands drbdadm would execute instead of actually executing them (for example, drbdadm -d up resource). this is literally such a useful way to learn how drbdsetup and drbdmeta are used. peak study method fr fr πŸ‘‘
  • -c, --config-file file β€” use an alternative configuration file. by default, drbdadm will use the first of the following files that exists: /etc/drbd-90.conf, /etc/drbd-84.conf, /etc/drbd-83.conf, /etc/drbd-82.conf, /etc/drbd-08.conf, /etc/drbd.conf.
  • -t, --config-to-test file β€” check an additional configuration file. heads up bestie, this option is only allowed with the dump and the sh-nop commands.
  • -s, --drbdsetup file β€” specifies the full path to the drbdsetup program. if you omit this option, drbdadm will look for it beneath itself first, and then in the PATH.
  • -m, --drbdmeta file β€” specifies the full path to the drbdmeta program. if you omit this option, drbdadm will look for it beneath itself first, and then in the PATH.
  • -S, --stacked β€” perform the command on a stacked resource. 🌈

πŸ”₯ COMMANDS πŸ”₯

okay this is the big one, buckle up. every single one, in order, no skips πŸ’–

adjust {resource}

adjust the configuration of the kernel module so that it matches the configuration files. the result should be the same as stopping and restarting all resources (drbdadm down all followed by drbdadm up all), but without the interruptions. slay.

⚠️ but note that the adjust command can misinterpret the configuration change in some cases. to be safe, check what the command would do (with the --dry-run option) before running the actual command. pls pls pls do this, bestie 😭

adjust-with-progress {resource}

the same as adjust, but with some more information about the command's progress. same vibe, more updates πŸ’…

apply-al {device}

apply the activity log of the specified device. see drbdmeta(8) for details.

repair-md {device}

check and repair metadata of the specified device. see drbdmeta(8) for details.

attach {device}

attach a lower-level device to an existing replicated device. see drbdsetup(8) for details.

check-resize {device}

call drbdmeta to eventually move internal meta data. if the backing device was resized while DRBD was not running, meta data has to be moved to the end of the device, so that the next attach command can succeed. ✨

connect {connection}

activate an existing 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}

parse the configuration file and dump it to stdout. this will fail if the configuration file is syntactically incorrect. 🫢

dump-md {device}

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

shows all commands which are not explicitly documented. πŸ‘€ secret menu energy.

invalidate {peer_device}

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 current 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] | [connection]}

show the current role of a resource, or the role of a resource on a peer.

secondary {resource}

change the role of a node in a resource to secondary. this command fails if the replicated device is in use. not a drill bestie 😭

show-gi {peer_device}

show the data generation identifiers for a device on a particular connection. in addition, explain the output. see drbdsetup(8) for details.

state {resource}

this is an alias for drbdsetup role. Deprecated. πŸ₯€ she's retired.

up {resource}

bring up a resource by applying the activity log of all volumes, creating the resource, creating the replicated devices, attaching the lower-level devices, and connecting to all peers. see the apply-al drbdmeta command and the new-resource, new-device, new-minor, attach, and connect drbdsetup commands.

verify {peer_device}

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 an unconnected peer from meta-data. see drbdmeta(8) for details.


⭐ VERSION ⭐

this document was revised for version 9.0.0 of the DRBD distribution.


πŸ’œ AUTHOR πŸ’œ

written by Philipp Reisner <philipp.reisner@linbit.com> and Lars Ellenberg <lars.ellenberg@linbit.com>. legends, honestly πŸ‘‘


πŸ™ˆ REPORTING BUGS πŸ™ˆ

report bugs to <drbd-user@lists.linbit.com>. found a gremlin? tell the group chat.


copyright 2001-2018 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. yeah fr, no warranty bestie, read the fine print πŸ’€


πŸ“ SEE ALSO πŸ“

drbd.conf(5), drbd(8), drbdsetup(8), drbdmeta(8) and the DRBD project web site[1]


🧚 NOTES 🧚

  1. DRBD project web site β€” http://www.drbd.org/

and that's the whole page, bestie πŸŽ€ this one shipped as part of DRBD 9.0.x and was dated 17 January 2018. go forth and drbdadm responsibly, mwah πŸ’…βœ¨