1

I am trying to rebuild a DRDB secondary on a new Debian Stretch server that I could never successfully make primary. /proc/drbd always reports the secondary as Diskless after a reboot. The drbd devices actually contains a lvm vg called "dr" which contains a lv called home. So this is LVM on top of DRBD. Running lsblk on the rebuilt secondary I generally see

sdd                  8:48   0 558.4G  0 disk
├─sdd1               8:49   0   101G  0 part
│ ├─dr-home       254:0    0    10G  0 lvm

where as the Primary has

sdd              8:48   0 558.4G  0 disk
├─sdd1           8:49   0   101G  0 part
│ └─drbd1      147:1    0   101G  0 disk
│   ├─dr-home 254:8    0    10G  0 lvm  /var/home

I rebuilt the secondary as follows

drbdadm down r1
wipefs --all /dev/sdd1 # gives "wipefs: error: /dev/sdd1: probing initialization failed: Device or resource busy" 
# however pvs,vgs and lvm dont mention 'dr' at all
# yet /etc/mapper/dr-home and /etc/dr/home exist 
dmsetup remove dr-home
wipefs --all /dev/sdd1 # now works
dd if=/dev/zero of=/dev/sdd1 count=1000000 # for good measure
drbdadm create-md r1
drbdadm up r1
cat /proc/drbd # reports drbd rebuilding
# after a while proc/drbd contains
# 1: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
reboot
# and proc/drbd now contains
#  1: cs:Connected ro:Secondary/Primary ds:Diskless/UpToDate C r-----

As best I can tell, during reboot something(device mapper ?) gets a hold of the devices before drbd does. Any ideas as to what is happening or how I can fix this? I dont understand what is happening during boot. I would love to understand how the system can tell the difference between drbd on top of lvm vs lvm on drdb during boot.

My /etc/lvm/lvm.conf contains

    filter = [  "r|/dev/sdd|", "r|/dev/sdd1|", "r|/dev/block/|", "a/.*/" ]

Thanks in advance!

ferg
  • 31
  • 5
  • Did you restart after editing your lvm.conf? You might even have to recreate your initramfs. And yes, that's DM (devicemapper) grabbing your DRBD "physical" volume so your secondary node get's diskless. Hence the lvm filter to not grab /dev/sdd. – vautee Dec 16 '19 at 14:12
  • Yes I rebooted after setting up the filter. I also went through the whole wipe and rebuild process after fixing the filter. – ferg Dec 16 '19 at 19:25

0 Answers0