How does LVM provide erased storage?

Hi,

I wonder how LVM makes sure to not expose data written in a previous qube when providing storage to another qube.

Any idea where I could find some documentation about this?

3 Likes

IIUC this is controlled by the /etc/lvm/lvm.conf option thin_pool_zero, enabled by default. See the “Zeroing” section in lvmthin(7).

5 Likes

this is exactly what I was looking for, thanks!

1 Like

Any idea how this mechanism is applied for a BTRFS backend?

For Btrfs and anything else backed by file-reflink (or even the legacy ‘file’ driver), a new volume is created as a sparse file, using the ftruncate syscall to extend a new zero length file to the volume size. Afterwards, “the extended part reads as null bytes”.

1 Like