[linux-lvm] exposing snapshot block device

Zdenek Kabelac zkabelac at redhat.com
Wed Oct 23 13:05:14 UTC 2019


Dne 23. 10. 19 v 14:20 Ilia Zykov napsal(a):
> On 23.10.2019 14:08, Gionatan Danti wrote:
>>
>> For example, consider a completely filled 64k chunk thin volume (with
>> thinpool having ample free space). Snapshotting it and writing a 4k
>> block on origin will obviously cause a read of the original 64k chunk,
>> an in-memory change of the 4k block and a write of the entire modified
>> 64k block to a new location. But writing, say, a 1 MB block should *not*
>> cause the same read on source: after all, the read data will be
>> immediately discarded, overwritten by the changed 1 MB block.
>>
>> However, my testing shows that source chunks are always read, even when
>> completely overwritten.
> 
> Not only read but sometimes write.
> I watched it without snapshot. Only zeroing was enabled. Before wrote
> new chunks "dd bs=1048576 ..." chunks were zeroed. But for security it's
> good. IMHO: In this case good choice firstly write chunks to the disk
> and then give this chunks to the volume.


Yep - we are recommending to disable zeroing as soon as chunksize >512K.

But for 'security' reason the option it's up to users to select what fits the 
needs in the best way - there is no  'one solution fits them all' in this case.

Clearly when you put a modern filesystem (ext4, xfs...) on top of thinLV - you 
can't read junk data - filesystem knows very well about written portions.
But if you will access thinLV device on 'block-level' with 'dd' command you 
might see some old data trash if zeroing is disabled...

For smaller chunksizes  zeroing is usually not a big deal - with bigger chunks 
it slows down initial provisioning in major way - but once the block is 
provisioned there are no further costs....

Regards

Zdenek




More information about the linux-lvm mailing list