[DRBD-user] drbd+lvm no bueno

Eric Robinson eric.robinson at psmnv.com
Mon Jul 30 17:03:35 CEST 2018


> > > > Lars,
> > > >
> > > > I put MySQL databases on the drbd volume. To back them up, I pause
> > > > them and do LVM snapshots (then rsync the snapshots to an archive
> > > > server). How could I do that with LVM below drbd, since what I
> > > > want is a snapshot of the filesystem where MySQL lives?
> > >
> > > You just snapshot below DRBD, after "quiescen" the mysql db.
> > >
> > > DRBD is transparent, the "garbage" (to the filesystem) of the
> > > "trailing drbd meta data" is of no concern.
> > > You may have to "mount -t ext4" (or xfs or whatever), if your mount
> > > and libblkid decide that this was a "drbd" type and could not be
> > > mounted. They are just trying to help, really.
> > > which is good. but in that case they get it wrong.
> >
> > Okay, just so I understand....
> >
> > Suppose I turn md4 into a PV and create one volume group
> > 'vg_under_drbd0', and logical volume 'lv_under_drbd0' that takes 95%
> > of the space, leaving 5% for snapshots.
> >
> > Then I create my ext4 filesystem directly on drbd0.
> >
> > At backup time, I quiesce the MySQL instances and create a snapshot of
> > the drbd disk.
> >
> > I can then mount the drbd snapshot as a filesystem?
> 
> Yes.
> Though obviously, those snapshots won't "failover", in case you have a node
> failure and failover during the backup.
> Snapshots in a VG "on top of" DRBD do failover.

Your advice (and Veit's) was spot on. I rebuilt everything with LVM under drbd instead of over it, added the appropriate filter in lvm.conf, and rebuilt my initramfs, and everything is working great. Failover works as expected without volume activation problems, and I could snapshot the drbd volume and mount it as a filesystem. You all hit it out of the park. Thanks!




More information about the drbd-user mailing list