Building DRBD v9 from scratch

tested on Slackware/142,current and Ubuntu/focal

Warning

Use kernel.org longterm, not stable. Otherwise you will face loads of troubles.

Requirements

Slackware

slackpkg install gc libffi libmpc ocaml coccinelle libcroco po4a
#otherwise assuming the D and L sets are installed

for pkg in gc libffi libmpc ocaml coccinelle libcroco po4a; do
    ls -lF /var/log/packages/$pkg-*
done; unset pkg
#ocaml-findlib

slackpkg install automake

Ubuntu

apt install build-essential automake

#for coccinelle
apt install ocaml ocaml-findlib

you need kernel headers in any case

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

ready to proceed

which spatch

Coccinelle

as binary

add-apt-repository ppa:npalix/coccinelle
apt install coccinelle

from source

git clone https://github.com/coccinelle/coccinelle.git
cd coccinelle/
./autogen
./configure
echo $MAKEFLAGS
make > ../coccinelle.log && echo BUILT

#was required on slackware
#no problem on ubuntu (gets created there)
mkdir -p /usr/local/lib/coccinelle/python/coccilib/

make install >/dev/null && echo INSTALLED
cd ../

Download DRBD v9 kernel module

Better get the latest release from LINBIT directly (github release tags do not always correspond to the latest available one).

#wget https://github.com/LINBIT/drbd/archive/drbd-9.0.25-1.tar.gz
#tar xzf drbd-9.0.25-1.tar.gz
#cd drbd-drbd-9.0.25-1/drbd/

wget https://www.linbit.com/downloads/drbd/9.0/drbd-9.0.26-0rc2.tar.gz
tar xzf drbd-9.0.26-0rc2.tar.gz
cd drbd-9.0.26-0rc2/drbd/

otherwise simply get the v9 branch already

git clone --branch drbd-9.0 --recursive https://github.com/LINBIT/drbd.git
cd drbd/drbd/

Build DRBD v9 kernel module

#make distclean
#make clean
make > ../../drbd9.log && echo BUILT
make install >/dev/null && echo INSTALLED
depmod -a

ls -lF /lib/modules/`uname -r`/updates/
find /lib/modules/`uname -r`/ -type f | grep drbd | xargs ls -lhF
cd ../../

DRBD tools

from source on slackware

slackpkg install libgcrypt libgpg-error libxml2
#libxslt
git clone --recursive https://github.com/LINBIT/drbd-utils
cd drbd-utils/
./autogen.sh
./configure --help | less
./configure --localstatedir=/var --sysconfdir=/etc \
    --with-xen --with-heartbeat --with-bashcompletion \
    --with-udev --without-manual
#--prefix=/usr
make clean
make > ../drbd-utils.log && echo BUILT
make install
ls -lF /etc/init.d/drbd
cd ../

binaries on ubuntu

add-apt-repository ppa:linbit/linbit-drbd9-stack
apt install drbd-utils

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/