[DRBD-user] drbd and LVM -> always getting duplicate volumes (was: can't use LVM2 on drbd devices)

Tomasz Chmielewski mangoo at wpkg.org
Tue Jan 15 15:19:52 CET 2008

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

Tomasz Chmielewski schrieb:
> Lars Ellenberg schrieb:
>>>> you did hear about udev and scsi id, did you?
>>> For iSCSI, true, I could use a link like /dev/iscsi/blah -> /dev/sdX 
>>> and put that /dev/iscsi/blah as a filter for lvm.conf.
>>> dm-crypt devices don't have any ID or anything unique (that I know).
>> you are supposed to be able to pass wanted major/minor numbers to
>> dmsetup. lvm e.g. is able to provide "persistent minors"
>> (persistent major theoretically only "mostly", not strictly, with kernel
>> 2.6, though for al practical purposes I found that to be good enough,
>> you get the same major anyways)
> All right, once I figure out how, I'll keep the list updated.

Something like this should take care of LVM duplicates:


DEVICE=$(dmsetup info $DRBD_DISK | awk '/^Major/{print $NF}')

ln -f -s /dev/dm-$DEVICE /dev/drbd-dm-device

And put a "/dev/drbd-dm-device" as a filtered device to lvm.conf.

Tomasz Chmielewski

More information about the drbd-user mailing list