All of lore.kernel.org
 help / color / mirror / Atom feed
* LVM on top of mdraid of LVM thin volumes on top of LUKS, aka LUKS+LVM+mdraid Tower of Babel
@ 2022-11-26 20:24 Roman Mamedov
  0 siblings, 0 replies; only message in thread
From: Roman Mamedov @ 2022-11-26 20:24 UTC (permalink / raw)
  To: Linux RAID list

Hello,

I am almost half-seriously considering this setup:

Disk 1
=> LUKS encrypted volume 1
==> LVM PV 1
===> LVM thin pool 1
====> LVM thin LV 1

Disk 2
=> LUKS encrypted volume 2
==> LVM PV 2
===> LVM thin pool 2
====> LVM thin LV 2

=====> mdadm RAID1 of LV-1 and LV-2
======> LVM PV
=======> LVM LVs (for individual VMs)

What leads me to this, is:

I want to store VM images, with a requirement that after trimming free space
on those VMs, their free space contains only zeroes, and as such is highly
compressible during backup.

This is apparently not possible directly on top of LUKS, since a trimmed
encrypted disk (with TRIM pass-through) returns random binary garbage in the
trimmed areas, by design of how the encryption works.

So one solution is to use LVM thin instead. A thinned thin LV always returns
zeros in the presently unmapped areas, and that also can be further ensured
with pre-zeroing on allocation (lvchange -Z).

Next, I only want to mirror a part of Disk 1 and Disk 2, not the entire disks.
But the encryption should span them entirely.
And it would be sweet to be able to dynamically resize the mirrored part in
both directions. Mirroring of thin LVs allows for that.

My main concern is will this all bring up itself successfully on boot,
probably it will, or can be made to.

What do you think, is there any other simpler topology that would satisfy all
the requirements?

Thanks

-- 
With respect,
Roman

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-26 20:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-26 20:24 LVM on top of mdraid of LVM thin volumes on top of LUKS, aka LUKS+LVM+mdraid Tower of Babel Roman Mamedov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.