Short tip: DRBD + EL7: /var/lib/drbd/drbd-minor-0.lkbd: No such file or directory
Recently I stumbled upon the following error message while creating a DRBD volume on CentOS 7:
1# drbdadm create-md r0
2initializing activity log
3NOT initializing bitmap
4Writing meta data...
5lk_bdev_save(/var/lib/drbd/drbd-minor-0.lkbd) failed: No such file or directory
6New drbd meta data block successfully created.
7lk_bdev_save(/var/lib/drbd/drbd-minor-0.lkbd) failed: No such file or directory
Oops! After executing the command the DRBD volume was unavailable as expected.
The reason for this issue was quite simple: the folder /var/lib/drbd
didn't exist. As a result drbdadm
was unable to create files. After creating the folder (and setting the SELinux flags) I was able to create the volume:
1# mkdir /var/lib/drbd ; restorecon -v /var/lib/drbd
2restorecon reset /var/lib/drbd context unconfined_u:object_r:var_lib_t:s0->unconfined_u:object_r:drbd_var_lib_t:s0
3# drbdadm create-md r0
I had this issue on a new CentOS 7 installation without further customizations - so it might also occur on Red Hat Enterprise Linux, Oracle Linux and Scientific Linux.