Upgrading DRBD 9 refreshes the userspace tools and the kernel module that runs replicated block devices. Plan the change node by node so each resource is synchronized before the node leaves service and again before the next peer is changed.
The package transaction does not replace a DRBD module that is already loaded in the running kernel. After packages are upgraded, the node must release its resources, unload the old module, load the new one, and show the intended DRBD_KERNEL_VERSION in drbdadm --version.
Within-version upgrades on manually managed nodes can use direct systemd and drbdadm control. If Pacemaker, DRBD Reactor, or LINSTOR owns the resource, place the node in that manager's maintenance or standby state instead of mixing manual systemd or drbdadm changes with the control plane.
$ sudo drbdadm status all
r0 role:Secondary
disk:UpToDate
node-a role:Primary
replication:Established peer-disk:UpToDate
Every affected volume should show UpToDate locally and on each peer before the upgrade window starts. Resolve Inconsistent, Outdated, disconnected, or resyncing resources first.
Related: How to check DRBD resource status
$ sudo apt update Hit:1 https://packages.example.net/debian drbd-9 InRelease Reading package lists... Done
Use the package manager that matches the node's repository source. On RPM-based systems, use the equivalent dnf upgrade step for the same maintenance window.
$ sudo apt --assume-yes upgrade The following packages will be upgraded: drbd-dkms drbd-utils 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. ##### snipped #####
The exact package names depend on the repository. drbd-utils provides drbdadm and drbdsetup, while the kernel module comes from a matching precompiled module package or drbd-dkms on DEB-based LINBIT installs.
Do not unload the DRBD kernel module while a file system, export, loop device, device-mapper stack, or application still has the replicated device open.
$ sudo systemctl stop drbd@r0.target
Replace r0 with the resource name. If a cluster manager owns the resource, use that manager's standby or maintenance action instead.
Related: How to manage DRBD resources with systemd
$ sudo rmmod drbd_transport_tcp
Use the loaded transport module for the resource. TCP-backed resources normally use drbd_transport_tcp; RDMA-backed resources use the matching DRBD RDMA transport module.
$ sudo rmmod drbd
If rmmod reports Module drbd is in use, a resource, mount, export, loop device, device-mapper stack, LVM physical volume, or application still holds DRBD open. Stop that owner before retrying.
$ sudo modprobe drbd
$ sudo drbdadm --version DRBDADM_API_VERSION=2 DRBD_KERNEL_VERSION_CODE=0x090202 DRBD_KERNEL_VERSION=9.2.2 DRBDADM_VERSION_CODE=0x091701 DRBDADM_VERSION=9.23.1
DRBD_KERNEL_VERSION must show the intended DRBD 9 module version. A value of 0 or an old 8.4 version means the expected module is not active.
$ sudo drbdadm up all
$ sudo systemctl start drbd@r0.target
Use the cluster manager's online or unstandby action instead when the resource is cluster-managed.
$ sudo drbdadm status all
r0 role:Secondary
disk:UpToDate
node-a role:Primary
replication:Established peer-disk:UpToDate
Wait for any resynchronization to finish before upgrading the next peer.
Related: How to verify DRBD synchronization state