[DRBD-user] Best way to use LVM with drbd

Lars Ellenberg lars.ellenberg at linbit.com
Fri Feb 15 13:37:27 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.


On Thu, Feb 14, 2008 at 11:04:59PM +0100, Rudolph Bott wrote:
> Harald Rinker schrieb:
> >Hi @all
> >
> >What is the best solution to use LVM with drbd
> >
> >i think there are 2 possible way?s to do so
> >
> >1. drbd on top of lvm
> I wouldn't recommend this - there's almost no point in this kind of 
> setup because you loose all the flexibility of LVM and its dynamic 
> logical volumes!
> 
> >2. lvm on top of drbd
> this is quite the way to go, but MAKE SURE (via /etc/lvm/lvm.conf or 
> whatsoever) that LVM *only* scans the drbd devices under /dev/
> Otherweise it might find the underlaying device (/dev/sdX or /dev/mdX 
> etc.) and brake your whole setup!
> 
> If you need to extend your storage you can add another drbd device 
> (maybe on top of another raid device or a new harddisk etc.) and add it 
> to your LVM setup as a new physical volume. Then extend your volume 
> group(s) to also use the new physical volume and you're done.
> 
> On top of that don't start LVM on the server which is currently the 
> secondary - it won't be able to find the LVM metadata on the drbd volume 
> because it is locked by the system. Which means if you fail over you 
> have to restart LVM/re-run the checks on the new primary to make sure 
> the system 'sees' all  of the volumes that have been 
> added/changed/removed on the old primary before it went down.
> 
> Another point is that you can use snapshots of your logical volumes to 
> create backups etc.
> Having drbd ON TOP of lvm would mean that you could only create 
> snapshots of logical volume(s) containing the drbd structures - which is 
> quite pointless in my eyes...


both have their purpose. you can even mix both, if you can deal with the
additional administrative complexity.

having drbd sitting on top of an lv is nice: you can replicate "just
enough" data, then grow later as the file system fills up.

snapshotting below drbd is a nice feature as well: you can snapshot the
secondary, and mount the snapshot on the secondary, for
backups/reports/consitency checks.

having a few drbd on lvm gives you the flexibility to migrate resources
independently.

having lvm on drbd makes your snapshots fail over with the resource
itself.

neither way is "better" per se, it always depends on your needs.


-- 
: Lars Ellenberg                           http://www.linbit.com :
: DRBD/HA support and consulting             sales at linbit.com :
: LINBIT Information Technologies GmbH      Tel +43-1-8178292-0  :
: Vivenotgasse 48, A-1120 Vienna/Europe     Fax +43-1-8178292-82 :
__
please use the "List-Reply" function of your email client.



More information about the drbd-user mailing list