# Understanding drbdadm verify and invalidate

**URL:** <https://forums.linbit.com/t/understanding-drbdadm-verify-and-invalidate/1290>\
**Category:** General\
**Tags:** drbd\
**Created:** [October 8, 2026, 11:53am UTC](https://forums.linbit.com/t/understanding-drbdadm-verify-and-invalidate/1290 "2026-10-08T11:53:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![candlerb](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@candlerb](https://forums.linbit.com/u/candlerb)\
**Post date:** [October 8, 2026, 11:53am UTC](https://forums.linbit.com/t/understanding-drbdadm-verify-and-invalidate/1290/1 "2026-10-08T11:53:41Z")

</div>

I have run `drbdadm verify` on a resource. This is for a resource which is currently primary on virtual6, secondary on virtual1 and virtual5; I ran drdmadm verify on virtual5.

The console on virtual5 logs that it’s finding lots of differences, e.g.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/linbit/original/1X/94cbd7a74dd8b13bc831526530b42b7effd14248.jpeg)

While the verify is running:

```auto
root@virtual5:/home/brian# drbdadm status pm-eb40ca57
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
  virtual1 role:Secondary
    replication:VerifyT peer-disk:UpToDate done:94.44
  virtual6 role:Primary
    peer-disk:UpToDate

root@virtual5:/home/brian# drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
      read:198159692 written:925764
  virtual1 role:Secondary
    replication:VerifyT peer-disk:UpToDate done:94.57
        received:0 sent:0 out-of-sync:3428248
  virtual6 role:Primary
    peer-disk:UpToDate
        received:614720 sent:0

```

After it has completed:

```auto
root@virtual5:/home/brian# drbdadm status pm-eb40ca57
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
  virtual1 role:Secondary
    peer-disk:UpToDate
  virtual6 role:Primary
    peer-disk:UpToDate

root@virtual5:/home/brian# drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
      read:209727184 written:925764
  virtual1 role:Secondary
    peer-disk:UpToDate
        received:0 sent:0 out-of-sync:4038396
  virtual6 role:Primary
    peer-disk:UpToDate
        received:614720 sent:0

```

This seems to be telling me that it’s virtual1 that’s out of date with respect to the primary, and virtual5 is fine?

I note that the drbdadm manpage says “See drbdsetup(8) for details”, and there it says:

```auto
Online verification compares each disk block on the local and peer node. Blocks which differ between the nodes are marked as out-of-sync, but they are **not** automatically brought back into sync. To bring them into sync, the drbdsetup invalidate or drbdsetup invalidate-remote with the --reset-bitmap=no option can be used. Progress can be monitored in the output of drbdsetup status --statistics.

```

OK, so I ran this on virtual5 (one of the secondaries, the one which I thought was clean):

```auto
root@virtual5:/home/brian# drbdadm invalidate pm-eb40ca57 --reset-bitmap=no
root@virtual5:/home/brian# drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:Inconsistent open:no
      read:209727824 written:1491300
  virtual1 role:Secondary
    replication:SyncTarget peer-disk:UpToDate done:14.00
        received:557432 sent:0 out-of-sync:3472860
  virtual6 role:Primary
    peer-disk:UpToDate resync-suspended:dependency
        received:614720 sent:0 out-of-sync:565536

root@virtual5:/home/brian# drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:Inconsistent open:no
      read:209727952 written:2502708
  virtual1 role:Secondary
    replication:SyncTarget peer-disk:UpToDate done:39.05
        received:1549248 sent:0 out-of-sync:2461452
  virtual6 role:Primary
    peer-disk:UpToDate resync-suspended:dependency
        received:614720 sent:0 out-of-sync:1576944

root@virtual5:/home/brian# drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
      read:209727952 written:4964160
  virtual1 role:Secondary
    peer-disk:UpToDate
        received:3786212 sent:0
  virtual6 role:Primary
    peer-disk:UpToDate
        received:614720 sent:0 out-of-sync:4038396

```

Then on virtual1 (the other secondary, the one which appeared to be dirty):

```auto
brian@virtual1:~$ sudo drbdadm invalidate pm-eb40ca57 --reset-bitmap=no
brian@virtual1:~$ sudo drbdadm status pm-eb40ca57
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
  virtual5 role:Secondary
    peer-disk:UpToDate
  virtual6 role:Primary
    peer-disk:UpToDate

brian@virtual1:~$ sudo drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
      read:670462960 written:100526454
  virtual5 role:Secondary
    peer-disk:UpToDate
        received:0 sent:3786212
  virtual6 role:Primary
    peer-disk:UpToDate
        received:0 sent:0 out-of-sync:4038460

brian@virtual1:~$ sudo drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
      read:670465520 written:100526454
  virtual5 role:Secondary
    peer-disk:UpToDate
        received:0 sent:3786212
  virtual6 role:Primary
    peer-disk:UpToDate
        received:0 sent:0 out-of-sync:4038460

```

And aftewards, checking on virtual6 (the primary):

```auto
brian@virtual6:~$ sudo drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Primary
  disk:UpToDate open:yes
      read:634683166 written:127129949
  virtual1 role:Secondary
    peer-disk:UpToDate
        received:0 sent:0 out-of-sync:4038460
  virtual5 role:Secondary
    peer-disk:UpToDate
        received:0 sent:614720

```

The primary is still showing “out-of-sync” counter against virtual1. Does this just reflect the count of blocks which _were_ out of sync during the verify scan, and is not reset after syncing?

So then I ran a new verify on virtual1:

```auto
brian@virtual1:~$ sudo drbdadm verify pm-eb40ca57
brian@virtual1:~$ sudo drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
      read:674744888 written:100526454
  virtual5 role:Secondary
    replication:VerifyS peer-disk:UpToDate done:1.02
        received:0 sent:3786212
  virtual6 role:Primary
    replication:VerifyS peer-disk:UpToDate done:1.02
        received:0 sent:0 out-of-sync:4038460

```

and I see the “out-of-sync” counter remains as it was: it has not dropped down to zero. I _am_ seeing new sync mismatches being logged though:

```auto
brian@virtual1:~$ sudo dmesg | tail; cat /proc/uptime
[31624775.236683] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=2441936, size=8 (sectors)
[31624775.236854] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=2441992, size=8 (sectors)
[31624775.236995] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=2442032, size=8 (sectors)
[31624775.237245] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=2442368, size=8 (sectors)
[31624775.237458] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=2442592, size=8 (sectors)
[31624775.237768] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=2443096, size=8 (sectors)
[31624775.248231] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=2444664, size=8 (sectors)
[31624775.283477] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=2445272, size=8 (sectors)
[31624775.283751] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=2445504, size=8 (sectors)
[31624784.033131] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=4214224, size=184 (sectors)
31624354.44 1486186569.66

```

(a bit later)

```auto
brian@virtual1:~$ sudo dmesg | tail; cat /proc/uptime
[31625190.437858] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999072, size=24 (sectors)
[31625190.437994] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999104, size=16 (sectors)
[31625190.438126] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999168, size=40 (sectors)
[31625190.438217] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999216, size=16 (sectors)
[31625190.438329] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999240, size=40 (sectors)
[31625190.438449] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999296, size=56 (sectors)
[31625190.438548] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999384, size=8 (sectors)
[31625190.438640] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999408, size=8 (sectors)
[31625190.438826] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999584, size=8 (sectors)
[31625190.438916] drbd pm-eb40ca57/0 drbd1009 virtual6: Out of sync: start=85999600, size=16 (sectors)
31624692.77 1486202306.11

```

But the “out-of-sync” stats counter is still not incrementing:

```auto
brian@virtual1:~$ sudo drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
      read:710311084 written:100526454
  virtual5 role:Secondary
    replication:VerifyS peer-disk:UpToDate done:9.51
        received:0 sent:3786212
  virtual6 role:Primary
    replication:VerifyS peer-disk:UpToDate done:9.49
        received:0 sent:0 out-of-sync:4038460

```

(a bit later)

```auto
brian@virtual1:~$ sudo drbdadm status pm-eb40ca57 --statistics
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
      read:769474256 written:100526454
  virtual5 role:Secondary
    replication:VerifyS peer-disk:UpToDate done:23.61
        received:0 sent:3786212
  virtual6 role:Primary
    replication:VerifyS peer-disk:UpToDate done:23.60
        received:0 sent:0 out-of-sync:4038460

```

This is now confusing me. Are these replicas in sync, or not? And if not, how do I bring them into sync?

Note: as I’m mid-migration, drbd versions are mismatched. virtual5 has drbd 9.3.4, while the other two nodes have 9.2.15

---

<div class="post-metadata">

**Author:** ![candlerb](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@candlerb](https://forums.linbit.com/u/candlerb)\
**Post date:** [October 8, 2026, 12:25pm UTC](https://forums.linbit.com/t/understanding-drbdadm-verify-and-invalidate/1290/2 "2026-10-08T12:25:25Z")

</div>

In an attempt to answer this question, I paused the VM in Proxmox, and then ran these roughly in parallel:

```auto
root@virtual1:/home/brian# ( while true; do dd bs=1024k count=1024 2>/dev/null | shasum; done ) </dev/drbd1009
be944acaeaf083978df18d73cb8f2d00b2fdcd96 -
ecaeda0928d2d1144abaa09b419cc3b793c144f8 -
6a5121865ce55c86d9707417db9eb35b6aa5dfa8 -
983607bb4f24486e862479c3ba0e756a50c9feba -
905e2d3870f83aa902e110a4c21dd92c9ada68ca -
fbaf12b5d4ee83f9d06fec80935aea477cd724f5 -
3251971d106b6b9624ec2e2502579959ba782857 -
cef50fa45f1f0987c2bd2c69d5acfdf904228366 -
6673770fe62a32b4ecbcfe0d3d8051bd8760576c -
8eeca8242ebf04b96a33611574f5396b41f53f54 -
6c855af81f0354fef08a9e09829b707c5f266af2 -
^C

```

```auto
root@virtual5:/home/brian# ( while true; do dd bs=1024k count=1024 2>/dev/null | shasum; done ) </dev/drbd1009
be944acaeaf083978df18d73cb8f2d00b2fdcd96 -
ecaeda0928d2d1144abaa09b419cc3b793c144f8 -
6a5121865ce55c86d9707417db9eb35b6aa5dfa8 -
983607bb4f24486e862479c3ba0e756a50c9feba -
905e2d3870f83aa902e110a4c21dd92c9ada68ca -
fbaf12b5d4ee83f9d06fec80935aea477cd724f5 -
3251971d106b6b9624ec2e2502579959ba782857 -
cef50fa45f1f0987c2bd2c69d5acfdf904228366 -
6673770fe62a32b4ecbcfe0d3d8051bd8760576c -
8eeca8242ebf04b96a33611574f5396b41f53f54 -
6c855af81f0354fef08a9e09829b707c5f266af2 -
^C

```

```auto
root@virtual6:/home/brian# ( while true; do dd bs=1024k count=1024 2>/dev/null | shasum; done ) </dev/drbd1009
be944acaeaf083978df18d73cb8f2d00b2fdcd96 -
2903b0fc204720071e002056269673172ad7cd16 - <<< NOTE
9d2a6582d157fbee0fea0f60456fc80ecaaad759 - <<< NOTE
983607bb4f24486e862479c3ba0e756a50c9feba -
905e2d3870f83aa902e110a4c21dd92c9ada68ca -
fbaf12b5d4ee83f9d06fec80935aea477cd724f5 -
3251971d106b6b9624ec2e2502579959ba782857 -
cef50fa45f1f0987c2bd2c69d5acfdf904228366 -
6673770fe62a32b4ecbcfe0d3d8051bd8760576c -
8eeca8242ebf04b96a33611574f5396b41f53f54 -
6c855af81f0354fef08a9e09829b707c5f266af2 -
^C

```

Ergh. It looks like the two secondaries agree with each other for the 11GiB I checked, but the primary does not.

I guess it’s possible this is some artefact, e.g. of a write to primary which for some reason was held up replicating to secondaries, or to do with discards on the underlying storage (which is LVM over SSD).

This is the block storage for a VM which was originally running on virtual5, before I live-migrated it to virtual6 in order to upgrade virtual5 (now done). I’d be a lot happier live-migrating it back to virtual5 if I could convince myself that the block storage is identical on both machines, or “make it so”.

`<THINKS>`: when I initially did `drbdadm invalidate` on virtual5, I didn’t specify which node to copy from. From the output, it looks like it copied from virtual1 (the other secondary, which was out of date). If that’s true, then I’d question why it doesn’t prefer the primary in this situation! In which case, now I’d better try forcing a copy from virtual6. It looks like `drbadm invalidate` supports a `--sync-from-peer-node-id=...` option.

---

<div class="post-metadata">

**Author:** ![candlerb](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@candlerb](https://forums.linbit.com/u/candlerb)\
**Post date:** [October 8, 2026, 12:49pm UTC](https://forums.linbit.com/t/understanding-drbdadm-verify-and-invalidate/1290/3 "2026-10-08T12:49:00Z")

</div>

```auto
root@virtual1:/home/brian# drbdadm dump pm-eb40ca57
# resource pm-eb40ca57 on virtual1: not ignored, not stacked
# defined at /var/lib/linstor.d/pm-eb40ca57.res:10
resource pm-eb40ca57 {
    on virtual1 {
        node-id 0;
        volume 0 {
            disk {
                discard-zeroes-if-aligned no;
                rs-discard-granularity 4096;
            }
            device minor 1009;
            disk /dev/sata_ssd/pm-eb40ca57_00000;
            meta-disk internal;
        }
    }
    on virtual5 {
        node-id 1;
        volume 0 {
            disk {
                discard-zeroes-if-aligned no;
                rs-discard-granularity 4096;
            }
            device minor 1009;
            disk /dev/drbd/this/is/not/used;
            meta-disk internal;
        }
    }
    on virtual6 {
        node-id 2;
        volume 0 {
            disk {
                discard-zeroes-if-aligned no;
                rs-discard-granularity 4096;
            }
            device minor 1009;
            disk /dev/drbd/this/is/not/used;
            meta-disk internal;
        }
    }
...

root@virtual1:/home/brian# drbdadm invalidate pm-eb40ca57 --sync-from-peer-node-id=2
root@virtual1:/home/brian# drbdadm status pm-eb40ca57
pm-eb40ca57 role:Secondary
  disk:Inconsistent open:no
  virtual5 role:Secondary
    replication:SyncTarget peer-disk:UpToDate done:0.18
  virtual6 role:Primary
    replication:PausedSyncT peer-disk:UpToDate done:0.00 resync-suspended:dependency

... after some delay ...

root@virtual1:/home/brian# drbdsetup status pm-eb40ca57
pm-eb40ca57 role:Secondary
  disk:Inconsistent open:no
  virtual5 role:Secondary
    replication:SyncTarget peer-disk:UpToDate done:59.93
  virtual6 role:Primary
    replication:PausedSyncT peer-disk:UpToDate done:0.00 resync-suspended:dependency

root@virtual5:/home/brian# drbdsetup status pm-eb40ca57
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
  virtual1 role:Secondary
    peer-disk:UpToDate
  virtual6 role:Primary
    peer-disk:UpToDate

root@virtual6:/home/brian# drbdsetup status pm-eb40ca57
pm-eb40ca57 role:Primary
  disk:UpToDate open:yes
  virtual1 role:Secondary
    replication:PausedSyncS peer-disk:Inconsistent done:0.00 resync-suspended:peer
  virtual5 role:Secondary
    peer-disk:UpToDate

```

This is making me nervous. especially the view on virtual1. Even if “SyncTarget” refers to the _local_ role, it still appears to be syncing from virtual5 not virtual6.

And yet, virtual5 isn’t showing anything going on!

EDIT: after that part completed I’m now seeing

```auto
root@virtual1:/home/brian# drbdsetup status pm-eb40ca57
pm-eb40ca57 role:Secondary
  disk:Inconsistent open:no
  virtual5 role:Secondary
    peer-disk:UpToDate resync-suspended:dependency
  virtual6 role:Primary
    replication:SyncTarget peer-disk:UpToDate done:6.32

root@virtual5:/home/brian# drbdsetup status pm-eb40ca57
pm-eb40ca57 role:Secondary
  disk:UpToDate open:no
  virtual1 role:Secondary
    peer-disk:Inconsistent resync-suspended:peer
  virtual6 role:Primary
    peer-disk:UpToDate

root@virtual6:/home/brian# drbdsetup status pm-eb40ca57
pm-eb40ca57 role:Primary
  disk:UpToDate open:yes
  virtual1 role:Secondary
    replication:SyncSource peer-disk:Inconsistent done:6.63
  virtual5 role:Secondary
    peer-disk:UpToDate

```

Also, iostat now shows high write activity on virtual1 and high read activity on virtual6, so it _does_ appear to be syncing virtual6-\>virtual1 (I should have checked iostat earlier). I can’t see why it would first sync from virtual5 and then sync from virtual6 though.

I do note the manpage for drbadm says `drdbadm invalidate` will “Replace the local data of a device with that of a peer”, as opposed to `drdbadm invalidate-remote` which will “Replace a peer device’s data of a resource with the local data”. So I’m still hopeful it’s not been overwriting virtual6.

---

<div class="post-metadata">

**Author:** ![colorfulcms](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@colorfulcms](https://forums.linbit.com/u/colorfulcms)\
**Post date:** [October 26, 2026, 3:02pm UTC](https://forums.linbit.com/t/understanding-drbdadm-verify-and-invalidate/1290/4 "2026-10-26T15:02:34Z")

</div>

The out-of-sync counter shown against a peer in --statistics is a running count of blocks marked out of sync during that connection’s verify or resync, so it doesn’t always drop back to zero afterwards. The verification on virtual1 still logging new “Out of sync” blocks is the more telling sign, since those are fresh mismatches. Since virtual5 is on 9.3.4 while the other two are on 9.2.15, it may be worth finishing the migration to matching versions and then re-running verify to see whether the mismatches go away. Also, were any of these blocks written while the resource was being used as swap or a Proxmox VM disk? Such workloads can legitimately cause verify differences.

---

<div class="post-metadata">

**Author:** ![candlerb](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@candlerb](https://forums.linbit.com/u/candlerb)\
**Post date:** [October 26, 2026, 6:23pm UTC](https://forums.linbit.com/t/understanding-drbdadm-verify-and-invalidate/1290/5 "2026-10-26T18:23:42Z")

</div>

I finished the migration (that VM got rather mangled and I ended up having to restore it from backup)

Once the upgrades were completed, I still had another problem with an apparently out-of-sync resource which I reported in [this thread](https://forums.linbit.com/t/drbd-resource-out-of-sync-after-node-reboot-what-to-do-next/1292), and then was able to reproduce in [this github issue](https://github.com/LINBIT/drbd/issues/155).

In short: the out-of-sync counter itself gets out of sync, and can report a value greater than zero even when the entire verify pass succeeds with no mismatched blocks detected.
