Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.
Hi.
To be able to use lvm on drbd devices i had to modify the file
/etc/lvm/lvm.conf, to exclude the phisical devive and include the logical
device.
This is what was modified:
# By default we accept every block device:
# filter = [ "a/.*/" ]
filter = [ "r|/dev/cdrom|", "r|/dev/sda6|", "a|/dev/drbd0|",
"r|/dev/sda7|", "a|/dev/drbd1|" ]
----- Original Message -----
From: "Tomasz Chmielewski" <mangoo at wpkg.org>
To: <drbd-user at linbit.com>
Sent: Monday, January 14, 2008 2:29 PM
Subject: [DRBD-user] drbd and LVM -> always getting duplicate volumes (was:
can't use LVM2 on drbd devices)
> After a couple of days of struggling I got to the point where I have to
> conclude that using LVM reliably over DRBD devices is impossible.
>
> As there are many users using LVM on DRBD, I would like to be corrected,
> of course.
>
> Below, a step-by-step configuration of DRBD and LVM:
>
>
> 1. A relevant part of drbd.conf - our drbd0 device is on /dev/sda:
>
> on san2 {
> device /dev/drbd0;
> disk /dev/sdb;
> address 192.168.111.158:7789;
> meta-disk internal;
> }
>
>
> 2. Create drbd0 meta data:
>
> # drbdadm create-md r0
>
>
> 3. Start DRBD:
>
> # /etc/init.d/drbd start
>
>
> 4. Initial device sync:
>
> # drbdadm -- --overwrite-data-of-peer primary all
>
>
> 5. Now, we should be able to create LVM - pvcreate first:
>
> # pvcreate /dev/drbd0
> Physical volume "/dev/drbd0" successfully created
>
>
> 6. Let's create a volume group - Houston, we have a problem!
>
> # vgcreate testvolume /dev/drbd0
> Found duplicate PV YIoJ98OFL3vhqhi7ek98UWkT7aBIzgrz: using /dev/sdb not
> /dev/drbd0
> Found duplicate PV YIoJ98OFL3vhqhi7ek98UWkT7aBIzgrz: using /dev/drbd0
> not /dev/sdb
> Found duplicate PV YIoJ98OFL3vhqhi7ek98UWkT7aBIzgrz: using /dev/sdb not
> /dev/drbd0
> Found duplicate PV YIoJ98OFL3vhqhi7ek98UWkT7aBIzgrz: using /dev/drbd0
> not /dev/sdb
> Volume group "testvolume" successfully created
>
>
> 7. pvs confirms it - LVM sits on /dev/sdb, not on /dev/drbd0 - certainly,
> nothing will be replicated by DRBD:
>
> # pvs
> Found duplicate PV YIoJ98OFL3vhqhi7ek98UWkT7aBIzgrz: using /dev/sdb not
> /dev/drbd0
> PV VG Fmt Attr PSize PFree
> /dev/sdb testvolume lvm2 a- 558.57G 558.57G
>
>
>
> As device names are not necessarily persistent (if /dev/sdb is a iSCSI
> drive, next time one boots it can be /dev/sdc) and a similar is for device
> mapper devices (think of crypted devices), setting up filters in lvm.conf
> will not be reliable.
>
> How can I use LVM over DRBD devices *reliably*?
>
>
>
> --
> Tomasz Chmielewski
> http://wpkg.org
> _______________________________________________
> drbd-user mailing list
> drbd-user at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-user
>