From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 05F531FF0E5 for ; Wed, 15 Jul 2026 12:27:02 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 557392147E; Wed, 15 Jul 2026 12:27:01 +0200 (CEST) Message-ID: <6e833e9b-8e77-4e03-b593-45945d521bd9@proxmox.com> Date: Wed, 15 Jul 2026 12:26:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH docs v9 5/5] fix #7339: lvm: document discard option To: Lukas Sichert , pve-devel@lists.proxmox.com References: <20260713160008.121125-1-l.sichert@proxmox.com> <20260713160008.121125-6-l.sichert@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260713160008.121125-6-l.sichert@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784111166486 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.246 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: EY2GOM3QZ2WZL4QEGXPRYVD5QAYOJ7TT X-Message-ID-Hash: EY2GOM3QZ2WZL4QEGXPRYVD5QAYOJ7TT X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 13.07.26 um 6:00 PM schrieb Lukas Sichert: > Document the new `on-volume-remove` property for LVM storage and its > initial `discard` action. > > Also update the `saferemove` description to match the range-based > zero-out worker and avoid referring to the old command-specific > implementation details. > > Signed-off-by: Lukas Sichert > Link: bugzilla.proxmox.com/show_bug.cgi?id=7339 > --- > pve-storage-lvm.adoc | 34 +++++++++++++++++++++++++++------- > 1 file changed, 27 insertions(+), 7 deletions(-) > > diff --git a/pve-storage-lvm.adoc b/pve-storage-lvm.adoc > index ba78663..3ddb26c 100644 > --- a/pve-storage-lvm.adoc > +++ b/pve-storage-lvm.adoc > @@ -44,18 +44,39 @@ accessed by other LVs created later (which happen to be assigned the same > physical extents). This is a costly operation, but may be required as a security > measure in certain environments. > + > -Storage devices that support the "write zeroes" operation will use `blkdiscard` > -to zero blocks. Otherwise, a fallback to `cstream` is performed. > +Storage devices that support the "write zeroes" operation use it to zero blocks. > +Otherwise, zeroes are written manually. The volume is processed range by range, > +according to `saferemove-stepsize`. > + > +`on-volume-remove`:: > + > +Configure additional actions to run before an LV is removed. [marker] for comment below > ++ > +Set `discard=1` to issue discard (TRIM) requests for the LV's blocks before the > +LV is removed, so thin-provisioned backing storage, such as a SAN LUN, can > +reclaim space the LV occupied. This is called "Discard Removed Volumes" > +in the web UI. Discard is rejected if any backing device in the "Discard is rejected" is a bit vague. Maybe "Configuring the discard option fails if..."? > +LV's volume group is detected as not supporting it. > ++ > +If wiping or discarding fails, the renamed `del-*` LV is kept and renamed to This is the first time the del- LV is mentioned. It could be mentioned at [marker] that the volume is renamed to del- when the cleanup starts. > +`failed--del-*`, so one can inspect it, retry cleanup manually, or remove > +it explicitly. > ++ > +If `saferemove` and `discard` are both enabled, the LV is processed range by > +range: one range is zeroed out and then discarded before continuing with the > +next range. This avoids allocating the whole LV with zeroes on thin-provisioned > +backing storage before the space can be reclaimed again. > > `saferemove-stepsize`:: > > -Wipe step size in MiB (`blkdiscard -p` parameter value), capped to the maximum > -step size supported by the underlying storage. Up to 32 MiB (maximum) by > -default. > +Wipe step size in MiB, capped to the maximum step size supported by the > +underlying storage. Up to 32 MiB (maximum) by default. > > `saferemove_throughput`:: > > -Wipe throughput (`cstream -t` parameter value), up to 10 MiB/s by default. > +Limits wipe throughput. If the backing storage supports the "write zeroes" > +operation, throughput is unlimited by default. Otherwise, manually written > +zeroes are limited to 10 MiB/s by default. > > `snapshot-as-volume-chain`:: > > @@ -150,4 +171,3 @@ See Also > > endif::wiki[] > > - Unrelated hunk