Deleting a DRBD resource permanently removes a replicated block-device definition from the nodes that know about it. Use it when a resource such as wwwdata has been retired, moved elsewhere, or rebuilt under a different name and must not start again after a reboot.

drbdadm reads resource definitions from the DRBD configuration and translates resource operations into drbdsetup and drbdmeta actions. The resource definition must stay in place until the resource is down and any metadata that should be removed has been wiped, because wipe-md needs the resource's device and backing-disk mapping.

The process must run on every node that has the resource definition. Stop applications or cluster managers first, keep any data backup or metadata dump needed for rollback, and leave other DRBD resources and package files in place unless the whole DRBD stack is being removed.

Steps to delete a DRBD resource:

  1. Record the resource definition and backing devices before changing anything.
    $ sudo drbdadm dump wwwdata
    resource wwwdata {
        on node-a {
            device           /dev/drbd0 minor 0;
            disk             /dev/vg0/wwwdata;
            meta-disk        internal;
            address          ipv4 192.0.2.10:7789;
        }
        on node-b {
            device           /dev/drbd0 minor 0;
            disk             /dev/vg0/wwwdata;
            meta-disk        internal;
            address          ipv4 192.0.2.11:7789;
        }
    }

    Use the actual resource name and device paths from the local configuration. Keep this output or a metadata dump outside the backing device if rollback might be needed.

  2. Stop the workload or cluster resource that uses the DRBD device.
    $ sudo systemctl stop wwwdata.service

    If Pacemaker or another cluster manager owns the resource, disable or remove the cluster resource first so it does not restart DRBD while the deletion is in progress.

  3. Confirm the DRBD device is not mounted.
    $ findmnt /dev/drbd0

    No output means no filesystem is mounted from that device. Unmount the filesystem before continuing if findmnt prints a mount point.

  4. Check the resource role on each node.
    $ sudo drbdadm status wwwdata
    wwwdata role:Secondary
      disk:UpToDate
      node-b role:Secondary
        peer-disk:UpToDate
  5. Demote any node that still shows the resource as Primary.
    $ sudo drbdadm secondary wwwdata

    The demotion fails if an application, filesystem, or cluster resource is still using the replicated device.

  6. Preview the operation that removes the resource from the running DRBD kernel state.
    $ sudo drbdadm --dry-run down wwwdata
    drbdsetup down wwwdata
  7. Take the resource down on every node that has the resource definition.
    $ sudo drbdadm down wwwdata

    drbdadm down removes the resource's volumes, connections, and runtime resource object. It does not remove the configuration file or application data on the backing device.

  8. Wipe the DRBD metadata only after the resource is down and rollback evidence is no longer needed.
    $ sudo drbdadm wipe-md wwwdata
    Do you really want to wipe out the DRBD meta data?
    [need to type 'yes' to confirm] yes
    Wiping meta data...
    DRBD meta data block successfully wiped out.

    This removes the DRBD metadata from the backing device. It does not replace an application backup and is hard to reverse.

  9. Remove the retired resource configuration file from every node.
    $ sudo rm /etc/drbd.d/wwwdata.res

    Remove only the resource file for the retired resource. Leave /etc/drbd.conf, /etc/drbd.d/global_common.conf, and other resource files in place when other DRBD resources still run on the node.

  10. Confirm drbdadm no longer loads the deleted resource.
    $ sudo drbdadm dump wwwdata
    no resources defined!

    The exact failure text can vary by drbd-utils version and local include layout. A successful final state is that the retired resource no longer appears in drbdadm dump all or drbdadm status output.