[linux-lvm] faster snapshot creation?

Douglas Paul doug at bogon.ca
Wed Feb 26 14:03:16 UTC 2020


On Wed, Feb 26, 2020 at 11:01:26AM +0100, Zdenek Kabelac wrote:
> If you are aspiring of creating tens of snapshot per second - you probably 
> have very unusual workflow/requirement and mostly likely lvm2 is not the right 
> tool for such task ATM.
> [...] 
> So my advice - if you really need to use and create old snaps in very fast way 
> is to developed your very own tool working in you restricted environment where 
> you  might probably not care about meta/data consistencies, deal with speed of 
> udev and gazillion other issues - you can run your small 'ioctl()' stream much 
> more efficiently.

For this workflow, it seems that using qemu-img in conjunction with
qemu-nbd might be a good option.

In this case, you build your reference image in a qcow image (as might
be used for a VM). For a test, you then create a temporary image based
on this reference image (using it as a backing file). Then you can mount
this new image using qemu-nbd to get a block device for it, and mount
the filesystem.

After your test is done, you can unmount, delete the nbd mapping, and
simply delete the temporary image you created.

It should be quite fast and lightweight. You should even be able to run
multiple tests in parallel.

-- 
Douglas Paul






More information about the linux-lvm mailing list