--- Begin Message ---
I found some doc on blkdiscard on redhat ovirt

https://www.ovirt.org/develop/release-management/features/storage/wipe-volumes-using-blkdiscard.html

"Let lunX be a device and dm-X be its corresponding dm device for a
natural number X. Then lunX is considered to support write same iff the
value of /sys/block/dm-X/queue/write_same_max_bytes is bigger than 0.

A device that supports write same is a device that allows to write a
single data block to a range of several contiguous blocks in the
storage.
That means that instead of writing a 1MB block of zeros 1024 times to
zero a volume of 1GB (as vdsm does with dd today), a single request to
write that 1MB block of zeros to the right range is enough, and the
rest is done by the storage array.
When calling blkdiscard -z <block_device>:

If the block device supports write same, then the kernel quickly zeroes
it using write same.
Else, the kernel zeroes it by writing pages of zeros.
"

(my test was without writesame support, so even wihout it, it's still a
lot faster than cstream).  



and for discard with zeroes:

"
Then lunX supports the property that discard zeroes the data ff the
value of /sys/block/dm-X/queue/discard_zeroes_data is 1"


(but here, some san can have bad implementation,so we can't auto
enabled i.  
Maybe we should check at minimum that discard_zeroes_data=1 if user
enable saferemove_discard, and fallback to classic zeroing if not ?



-------- Message initial --------
De: Wolfgang Bumiller <w.bumil...@proxmox.com>
À: "DERUMIER, Alexandre" <alexandre.derum...@groupe-cyllene.com>
Cc: pve-devel@lists.proxmox.com <pve-devel@lists.proxmox.com>
Objet: Re: [pve-devel] [PATCH pve-storage] lvm: use blkdiscard instead
cstream to saferemove drive
Date: 14/08/2025 14:05:51

On Thu, Aug 14, 2025 at 10:07:59AM +0000, DERUMIER, Alexandre wrote:
> > +        saferemove_discard => {
> > +            description => "Wipe with discard instead zeroing.",
> > +            type => 'boolean',
> 
> > > Not sure we need this (not sure when this is actually useful),
> > > but
> > > it's
> > > cheap enough to have around. Should add a `default => 0` for
> > > documentation purposes, though.
> 
> Some storage allow overprovisioning. (create a lun bigger than the
> real
> storage size), it can be interesting to discard instead zeroing (to
> free space on storage side).
> as snapshots currently use lvm volume with same size than the main
> volume, it can be interesting to have overprovisioning.

But this does not guarantee that the data is actually erased/zeroed, in
which case I'd just disable the thing altogether (but then again I use
`issue_discards` in lvm.conf to cause `lvremove` to discard the whole
thing... ;-)


--- End Message ---
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to