Building DRBD v9 kernel module

tested on ubuntu/focal and slack150

warning // lessons learned

DRBD kernel module won’t build on any kernel version. Carefully read latest ChangeLog updates from the latest release and check for supported kernel version. Otherwise you will face loads of troubles.

Beside that, use kernel.org longterm, not stable.

The building system offers an online Coccinelle patching system –or– you can otherwise have it locally.

requirements

you need the kernel source

uname -r
ls -lF /lib/modules/`uname -r`/build
ls -lF /lib/modules/`uname -r`/source

ubuntu

apt install build-essential automake

slackware

in case you don’t have the D K L sets installed

slackpkg install gc libffi libmpc automake
# kernel-source

build env requirements

non-dom0

you need enough memory to build, make sure you’re not running a memory capped dom0

free -m

eventually reboot when needed

vi /boot/syslinux/syslinux.cfg

#default xen
default linux

reboot

fast storage

make sure you’re on a fast-enough storage medium (namely not on a memstick) – e.g. when running on a flash reader, better use faster storage volume

mkdir /data/tp/

cd ~/
ln -s /data/tp
cd tp/

build & deploy

grab the latest release from LINBIT directly, as the github release tags are usually not up-to-date.

ver=9.3.3

wget https://pkg.linbit.com/downloads/drbd/9/drbd-$ver.tar.gz
tar xzf drbd-$ver.tar.gz
cd drbd-$ver/drbd/

now build the DRBD v9 kernel module

#make distclean
#make clean

echo $MAKEFLAGS

time nice make > ../../drbd-$ver.log && echo BUILT
time nice make install >/dev/null && echo MODULES DEPLOYED
depmod -a
#ver=5.15.27
#make KVER=$ver KDIR=/usr/src/linux-$ver > ../../drbd.log && echo BUILT
#make install KVER=$ver KDIR=/usr/src/linux-$ver >/dev/null && echo DEPLOYED
#depmod -a $ver

kernel=`uname -r`

ls -lF /lib/modules/$kernel/updates/
for f in `ls -1 /lib/modules/$kernel/updates/*.ko`; do
    echo === $f ===
    modinfo $f
    echo
done; unset f

unset kernel

modprobe drbd
dmesg | grep drbd

troubleshooting

see drbd-source-troubles – in a nutshell, use kernel.og longterm, not stable

resources

guides

DrBd https://wiki.debian.org/DrBd

Index of / https://www.linbit.com/downloads/tech-guides/

DRBD Quick Command Reference https://www.linbit.com/downloads/tech-guides/DRBD_Quick_Reference_Guide.pdf

(gone) https://paste.fedoraproject.org/paste/kZTXesmKVZBBqR-iLwialA

How to Setup DRBD to Replicate Storage on Two CentOS 7 Servers https://www.tecmint.com/setup-drbd-storage-replication-on-centos-7/

download

libint’s official releases https://www.linbit.com/en/drbd-community/drbd-download/

releases at github https://github.com/LINBIT/drbd/releases

LINBIT https://github.com/LINBIT

Index of /downloads http://www.linbit.com/downloads/

Index of /downloads/drbd/9.0 http://www.linbit.com/downloads/drbd/9.0/

All Downloads https://www.linbit.com/linbit-software-download-page-for-linstor-and-drbd-linux-driver/

build

3.4. Compiling packages from source https://www.linbit.com/drbd-user-guide/drbd-guide-9_0-en/#s-from-source

3.4. Compiling packages from source https://docs.linbit.com/docs/users-guide-9.0/#s-from-source

Building DRBD9 https://www.alteeve.com/w/Building_DRBD9

How to Setup DRBD to Replicate Storage on Two CentOS 7 Servers https://www.tecmint.com/setup-drbd-storage-replication-on-centos-7/

DRBD 9 : Install https://www.server-world.info/en/note?os=CentOS_7&p=drbd9&f=1

Compile drbd9 on CentOS7 https://zero.latelan.com/2018-05-23/compile-drbd9-on-centos7/

How-to: Install drbd as a kernel module https://www.linode.com/community/questions/3211/how-to-install-drbd-as-a-kernel-module

HOME | GUIDES | PLAYBOOKS | LECTURES | LAB | CONTACT | HTML | CSS
Licensed as MIT