DRBD LVM - Lower device is already claimed

Update:

On Ubuntu 11.04 Natty Narval i had to edit

/etc/lvm/lvm.conf

in the section "devices" and to set a filter like this

filter = [ "a|/dev/drbd[0-9]|" "r/.*/" ]

to prevent the detection of underlying native block devices by lvm.

Then i'd to command this:

update-initramfs -u

reboot




When you use a DRBD device as an underlying block device for lvm as described in the drbd manual you may face the following error after reboot and start DRBD. Lower device is already claimed The reason is the lack of the lvm.conf in the initramfs. To add this file to the initramfs simply follow these steps: edit the file

/usr/share/initramfs-tools/hooks/lvm2

and add

[ -r /etc/lvm/lvm.conf ] && mkdir $DESTDIR/etc/lvm && cp /etc/lvm/lvm.conf $DESTDIR/etc/lvm

after the lines contains


cp -p /etc/udev/rules.d/85-lvm2.rules ${DESTDIR}/etc/udev/rules.d

so that it looks like

cp -p /etc/udev/rules.d/85-lvm2.rules ${DESTDIR}/etc/udev/rules.d
[ -r /etc/lvm/lvm.conf ] && mkdir $DESTDIR/etc/lvm && cp /etc/lvm/lvm.conf $DESTDIR/etc/lvm


then you have to rebuild the initramfs using

update-initramfs -u

and to restart the system in order to modifications can take effect

reboot

Now DRBD should start as wanted, assuming you had modified the lvm.conf as mentioned in the link.

Did it work for you - just drop your comments on it.

5 comments:

Dave Dave said...

This certainly solved my startup problem. Many thanks.

Now onto heartbeat's problems...

Nudge said...

Thanks a lot! Saved me quite some hours. :-)

Anonymous said...

Nice tip. Thanks.

Anonymous said...

Thanks for this, I was able to recover what I thought was a lost cause.

John Wesorick said...

Thanks! I was tearing my hair out on this one for half a day.