From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 81CD2B3215 for ; Tue, 28 Nov 2023 15:38:05 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 640B619017 for ; Tue, 28 Nov 2023 15:38:05 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 28 Nov 2023 15:38:04 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6942E41035 for ; Tue, 28 Nov 2023 15:38:04 +0100 (CET) Message-ID: Date: Tue, 28 Nov 2023 15:38:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: pbs-devel@lists.proxmox.com References: <20231128132323.162721-1-m.frank@proxmox.com> From: Max Carrara In-Reply-To: <20231128132323.162721-1-m.frank@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.063 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pbs-devel] [PATCH proxmox-backup v3 0/6] fix #3690: wipe disk X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2023 14:38:05 -0000 On 11/28/23 14:23, Markus Frank wrote: > Wipe a disk/partition like we do in PVE. (wipefs, dd, change_parttype to 0x83 > with sgdisk) > > v3: > * rebase on master > * added more informations to commit message > > v2: > * change unwraps to matches > * renamed regex Looks pretty good overall to me; however, I do have a couple things to note: * It's possible to also wipe individual partitions using this (as the code suggests) so maybe a it would be beneficial or more user-friendly to change the text of e.g. the button to "Wipe Partition" if the user clicks on a partition instead of a disk? Or maybe just change it to "Wipe" to cover both cases? * An error will be thrown if one attempts do wipe a disk / partition that's currently mounted: # proxmox-backup-manager disk wipe sdd wipe disk sdd Wiping block device /dev/sdd TASK ERROR: command "wipefs" "--all" "/dev/sdd1" "/dev/sdd" failed - status code: 1 - wipefs: error: /dev/sdd1: probing initialization failed: Device or resource busy Maybe this case could be handled in a more user-friendly manner as well? E.g. checking which disks / partitions are mounted first and then showing an error with a more expressive message. * There are a couple things clippy seems to complain about, but nothing that's an immediate code smell. Overall it looks pretty good to me though; the things I mentioned above are somewhat bikesheddy can also be addressed in a follow-up. Tested-by: Max Carrara Reviewed-by: Max Carrara > > Markus Frank (6): > fix #3690: pbs_api_types: add regex, format & schema for partition > names to pbs-api-types > fix #3690: tools: add wipe_blockdev & change_parttype rust equivalent > fix #3690: api: add function wipe_disk > fix #3690: cli: add function wipe_disk > fix #3690: ui: enable wipe disk in StorageAndDisks > tools: prohibit disk wipe of EFI partition > > pbs-api-types/src/lib.rs | 10 ++ > src/api2/node/disks/mod.rs | 53 +++++++++- > src/bin/proxmox_backup_manager/disk.rs | 38 ++++++- > src/tools/disks/mod.rs | 138 ++++++++++++++++++++++++- > www/Utils.js | 1 + > www/panel/StorageAndDisks.js | 1 + > 6 files changed, 232 insertions(+), 9 deletions(-) >