Parsing error and DRBD versions

Why would I get a parse error on this config on a host running DRBDADM 9.31.0 but not on 9.28.0?

resource nchub {
  device /dev/drbd19;
  disk   /dev/vg0/nchub;
  meta-disk internal;
  on trk-kvm-02 {
    node-id   2;
  }
  on trk-kvm-04 {
    node-id   4;
  }
  connection {
    host  trk-kvm-02  address 10.10.2.186:7286;
    host  trk-kvm-04  address 10.10.2.187:7287;
  }
}

on trk-kvm-02 it parses fine and I can create the resource:

$ sudo drbdadm status nchub
nchub role:Secondary
  disk:Inconsistent
  trk-kvm-04 connection:Connecting

using 9.28.0

@trk-kvm-02: $ sudo drbdadm --version
DRBDADM_BUILDTAG=GIT-hash:\ ba2ce9037989b6141222c7901d1219cf852949f1\ build\ by\ buildd@lcy02-amd64-074\,\ 2024-05-06\ 09:10:36
DRBDADM_API_VERSION=2
DRBD_KERNEL_VERSION_CODE=0x090209
DRBD_KERNEL_VERSION=9.2.9
DRBDADM_VERSION_CODE=0x091c00
DRBDADM_VERSION=9.28.0

but the exact same file on trk-kvm-04 with 9.31.0-rc.1 fails with:

$ sudo drbdadm create-md nchub
drbd.d/nchub.res:6: Parse error: 'disk | device | address | meta-disk | flexible-meta-disk' expected,
        but got 'node-id'

the only difference I can see is the version of DRBD:

@trk-kvm-04:~$ sudo drbdadm --version
DRBDADM_BUILDTAG=GIT-hash:\ 2411ff2e4241716463b4afa8530dc3c628c157ce\ build\ by\ buildd@lcy02-amd64-089\,\ 2025-03-24\ 09:51:42
DRBDADM_API_VERSION=1
DRBD_KERNEL_VERSION_CODE=0x000000
DRBDADM_VERSION_CODE=0x091f00
DRBDADM_VERSION=9.31.0-rc.1

I was expecting both versions to accept the same syntax.

What am I missing?

Can you verify that the DRBD 9 kernel module is actually loaded (cat /proc/drbd)?

drbd-utils checks which version of the kmod is loaded into the kernel and then uses the DRBD 8 or DRBD 9 parser accordingly. node-id is a DRBD 9 option but not available in DRBD 8.

Thanks for this,

Nothing is loaded at all it seems.

This is a new host and my first resource to add. I can’t get past create-md:

@trk-kvm-04:/etc/drbd.d$ sudo drbdadm create-md nchub.res
drbd.d/nchub.res:6: Parse error: 'disk | device | address | meta-disk | flexible-meta-disk' expected,
        but got 'node-id'
@trk-kvm-04:/etc/drbd.d$ sudo cat /etc/drbd
cat: /etc/drbd: No such file or directory

Actually - it is not accurate to say a new host, it was used in the past and may have DRBD8 on there. How can I force it to use DRBD 9? I expected to see only DRBD9 after issuing:

add-apt-repository ppa:linbit/linbit-drbd9-stack

then updating. It did install DRBD 9, I even rebooted the host expecting to have DRBD9 across the board.

What am I missing?

I noticed that you are using a PPA and a release candidate (rc) version of drbdadm. I will speculate that there are broken dependencies that weren’t met with the upgrade/install and so your node fell back on the DRBD kmod in the mainline kernel (DRBD 8.4). I will check in with the development team about this.

[edited post to remove some wrong advice.]

This looks more like a kernel module issue than a drbd-utils issue. Can you please provide the output of uname -a and cat /etc/os-release?

Thanks for looking into this guys.

@trk-kvm-04:~$ uname -a
Linux trk-kvm-04 5.15.0-135-generic #146-Ubuntu SMP Sat Feb 15 17:06:22 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

@trk-kvm-04:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

What specifically are yo looking for in there?

Please and thanks

Paul

I have a slightly different kernel (just 1 minor newer), which should not matter, and everything works as expected. I installed the kernel module via dkms from the PPA (apt install drbd-dkms):

root@ubuntu-jammy-23:~# drbdadm --version
DRBDADM_BUILDTAG=GIT-hash:\ 2411ff2e4241716463b4afa8530dc3c628c157ce\ build\ by\ buildd@lcy02-amd64-089\,\ 2025-03-24\ 09:51:42
DRBDADM_API_VERSION=2
DRBD_KERNEL_VERSION_CODE=0x09020d
DRBD_KERNEL_VERSION=9.2.13
DRBDADM_VERSION_CODE=0x091f00
DRBDADM_VERSION=9.31.0-rc.1
root@ubuntu-jammy-23:~# uname -a
Linux ubuntu-jammy-23 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

From what I see you don’t have a valid DRBD9 kernel module for the kernel you are running.

What I would do:
apt install --reinstall drbd-dkms and look for any errors. If everything looks fine, then a modinfo -F version drbd. If that shows a version 9, then rmmod drbd (just to make sure a loaded 8.4 is unloaded), modprobe drbd, cat /proc/drbd to see if the version 9 module really is loaded.

tl;tr: not an utils issue at all, for whatever reason you don’t have a valid DRBD9 kmod for your kernel (headers missing?).

1 Like

Brilliant!

You nailed it and I am back up and syncing!

The reinstall went perfectly, DRBD9 installed and kernel module manually loaded.

I very much appreciate the guidance.

1 Like

How to install drbd on Redhat or Ubuntu and then start it automatically at boot
All commands below are executed with root privileges.

]# echo drbd > /etc/modules-load.d/drbd.conf

Usually, when loading manually, as mentioned above
]# modprobe drbd

How to check if the driver is loaded
]# modinfo drbd

Checking if it is loaded at the kernel level
]# lsmod | grep -i drbd
drbd 568697 0
libcrc32c 12644 2 drbd

That’s it.