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 89BCF1FF0E2 for ; Thu, 30 Jul 2026 16:34:27 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id DE22D214A6; Thu, 30 Jul 2026 16:34:26 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 30 Jul 2026 16:34:23 +0200 Message-Id: From: =?utf-8?q?Michael_K=C3=B6ppl?= To: "Lukas Sichert" , Subject: Re: [PATCH docs/manager/storage v11 0/6] fix #7339: lvmthick: add option to free storage for deleted VMs X-Mailer: aerc 0.21.0 References: <20260723135656.102972-1-l.sichert@proxmox.com> In-Reply-To: <20260723135656.102972-1-l.sichert@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785422055055 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.295 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: Q7GQ2PWB3JH7UVTGR2ULBQJCGANC6XDI X-Message-ID-Hash: Q7GQ2PWB3JH7UVTGR2ULBQJCGANC6XDI X-MailFrom: m.koeppl@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: Tested this version using a PVE guest with a disk with discard=3D1 on a thin-provisioned LVM storage. I then created a thick-provisioned LVM in the guest on which I allocated VM disks, wrote data to them, and freed them under varying settings: - With `pvesm set sanA --saferemove 1`, the data was actually zeroed out and usage actually grew since the disk is fully allocated by this - With `pvesm set sanA --delete saferemove --on-volume-remove discard=3D1`, the previously allocated disk space was reclaimed as expected - I also tried various settings for saferemove-stepsize and saferemove_throughput, confirming that the settings are actually applied during removal of the volume - `pvesm set sanA --saferemove 1 --on-volume-remove discard=3D1` showed the data being zeroed-out in the logs and reclaimed the space, but I noticed something described in more detail below On 2/6 I noted that I'm not sure that the data is actually zeroed-out on the disk with syswrite. I tested this as well as follows: - pvesm alloc sanc 913 vm-913-disk-0 4G - Write 4G of a recognizable, super secret string to the disk - pvesm free sanc:vm-913-disk-0 --> zeroed out the data according to the logs - pvesm alloc sanc 913 vm-913-disk-0 4G - Read from the disk The hex dump showed the data still being there after zero-out: 00000000: 4554 2d56 4d2d 4441 5441 2d44 4f2d 4e4f ET-VM-DATA-DO-NO 00000010: 542d 4c45 414b 0a53 4543 5245 542d 564d T-LEAK.SECRET-VM 00000020: 2d44 4154 412d 444f 2d4e 4f54 2d4c 4541 -DATA-DO-NOT-LEA So it seems the data is not actually guaranteed to be zeroed-out, but the space is reclaimed and the logs suggest that everything worked as expected. Adding an fsync call as suggested on 2/6 seems to fix this, the hex dump then looks like this: 00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................ On Thu Jul 23, 2026 at 3:56 PM CEST, Lukas Sichert wrote: > Logical volumes (LV) in an LVM (thick) volume group (VG) are > thick-provisioned, but the underlying backing storage can be > thin-provisioned. In particular, this can be the case if the VG resides > on a LUN provided by a SAN via iSCSI/FC/SAS [1], where the LUN may be > thin-provisioned on the SAN side. [snip]