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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A73F7B33D0 for ; Tue, 28 Nov 2023 23:01:33 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 86D5C1CED6 for ; Tue, 28 Nov 2023 23:01:33 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 28 Nov 2023 23:01:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1701208891; x=1701813691; i=devzero@web.de; bh=rH3qH2rN6N58IeJ3GBZ0Db5Ofjs/k/ZRwnnuFopXUhU=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=UBHHyoMHRoZsh9QQ58y0wb7uRnAiheC+z+aTN+GHldwgEAo7wQu8tqi52yUFKho0 zCjE7/cI3NH+atON2lSqjjL9INxEnzie2mOHUnO/kdndtYpA9CzQ0dMBTiltLQa7H nGehlJ4ne9x7t25ZN0ixwto8kgKVqe3ViBfEq6H49slU2NnWzZhSdMd/tk4rHj7GI EM71XNcIcWAWQzvWk+givBE8eMWa3QWEoSnQLSH5vcHlZjIszZP11LkYrlS2DCwKH 2kGxHsDKIPU3vkdR/qTQraPVz165fUOIqQhq0LzwNuKmy7DSr+U96k6wfhR8LSgHR z6eNpSxxerjeLW5hVg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.179.90] ([89.1.134.98]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N2BI2-1rHUjF16OE-013qkp; Tue, 28 Nov 2023 22:56:11 +0100 Message-ID: <64bf7354-282a-4e93-9a35-6058088eb728@web.de> Date: Tue, 28 Nov 2023 22:56:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox Backup Server development discussion , Thomas Lamprecht , Markus Frank References: <20231128132323.162721-1-m.frank@proxmox.com> <20231128132323.162721-7-m.frank@proxmox.com> <62803cbd-388d-4ec8-8e57-0cb7ea836413@proxmox.com> From: Roland In-Reply-To: <62803cbd-388d-4ec8-8e57-0cb7ea836413@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:HHObvKCV+sg4O18fD6I6tD4uzTfJkhoSFXoHi+NIMPRu+iuGOzm sVTf2wqPS0m93LgaS+mPR3yNir4eEz5pxDWkq7CGEL6SxN44kajO+H1htQIzGoKwm1uk/Uo o6ABcFkcXImC4V0REa0v3IPUsZVQZt9x1dCivQYYCBEmcQ+aabgDMJ/6leKzjW/GCTN7v3Z M7G3gsxSpHTv83Ab6xiZQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:93gDzK8pqT8=;GmWEzsxY1P2YRAqxf6VzlBy7pQa w2fvw9+yfdUwtG/Wu+JulZmMK7AtkCZoFi/nLTivR+LXSsCIHdTSuQ40wQ9oyDpzz0sqQYL+D MT8GuM4KFO72QcSEPS+WuQKRd5ttLK9n3Urxb//iqc+Rsp8LPsGFs5Jpm6+0/zIxkcxYycnZq l5duJJjP2aGUatuB4wwiYUdRuXzEZB5vGJoM6tCDHlio7z3VIEvBu3FVm/85uPFQx+rrJkpHp CGStpchVjt6/qD3tpeM1crD5JUPSmhukCHTBS9fmO8uEWW6bBM+E8hywxeL0PIMhoXhAsXFnl bZMt80aR2Vy1YECcX2gyM7JgU9WxLploa7Jps8wYiUz2vJkD47jorfPMh1Qs4KLg0RwGfhWD2 XxRcHzNDZUntlfXwCEAfGU30x/AdZoBmd61LaSdVJWgezfZNjosmFOfeJXRWcQ9Vom3fbRr2o v+kbF8mzU4jOjJjSxfIUEFBNXHNzmKats19ML4I3TU38jVcIAY3KMhzyr/5yIr1Q/ttb6HHtr xmXsVN8qjHLxi+kgQSb4AeM+mZEaocksavBoHntph/2y6kTJJnCzRE2IZwVxIu494bLmoA4Si ArSQKriZAcEzfffNgTEb1zd9L+1Y4nV1/dIjgoeszoVfNhZ6q5jg6dIBVBuBssk5UDY9P3oxa FkdjC70UiGqIbQUkpyedM/C0U68BIkszjJsLZFepVsjU8Oacbr+jCC7g8FYOeL5PTX6umqTh6 Gr+J1u5f7DDAjibAOPnXaDmcGRESB53Sk0W5kROX0154Lp5CYHGPRQMWoL/8EnHFVdX+q7h1U 4ujICq1ZV/AIkHzpZzacKKC/BfPEnVia7hAAo8DzZVyB9wA64Z0OIAV+mIvcbxePhJpXSo4Ui Dx8aMO9eRSvQz4Pk4qrIRHttwHkrUC1XEKU17tNRG5ie0BGKpxPNIBlaoavEd0aGqmoMIq1Bu xBF17g== X-SPAM-LEVEL: Spam detection results: 0 AWL 0.232 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust RCVD_IN_MSPIKE_H3 0.001 Good reputation (+3) RCVD_IN_MSPIKE_WL 0.001 Mailspike good senders 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 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [mod.rs, proxmox.com] Subject: Re: [pbs-devel] [PATCH proxmox-backup v3 6/6] tools: prohibit disk wipe of EFI partition 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 22:01:33 -0000 >This patch is based on a suggestion by Dominik. >I am not so sure if we should prohibit wiping EFI partitions. >Any opinions on this? i'm a systems admin and following pbs/pve dev a little bit and i just stumbled across this, raising an eyebrow i'd second what thomas writes - why shoud a disk with efi partitions be protected from wiping? it could be ANY important disk with ANY important data on it, no matter of there is a efi partition or not. i we add a disk we want to use and want to wipe - we just want to wipe, no matter what's on it. >- such special partitions get an extra, specific warning in the UI about = the > potential impact yes, that would be probably good. when wiping a disk, you always should think twice and double check, anyway... roland Am 28.11.23 um 18:48 schrieb Thomas Lamprecht: > Am 28/11/2023 um 14:23 schrieb Markus Frank: >> If the GUID is c12a7328-f81f-11d2-ba4b-00a0c93ec93b the partition is an >> EFI Partition and should not be wiped. >> >> Since this GUID is used multiple times, a constant for the EFI & BIOS >> GUID is useful. >> >> Signed-off-by: Markus Frank >> --- >> src/tools/disks/mod.rs | 13 +++++++++++-- >> 1 file changed, 11 insertions(+), 2 deletions(-) >> >> diff --git a/src/tools/disks/mod.rs b/src/tools/disks/mod.rs >> index beb8178b..0fe57d23 100644 >> --- a/src/tools/disks/mod.rs >> +++ b/src/tools/disks/mod.rs >> @@ -39,6 +39,9 @@ lazy_static::lazy_static! { >> regex::Regex::new(r"host[^/]*/session[^/]*").unwrap(); >> } >> >> +const EFI_PARTITION_TYPE: &str =3D "c12a7328-f81f-11d2-ba4b-00a0c93ec9= 3b"; >> +const BIOS_PARTITION_TYPE: &str =3D "21686148-6449-6e6f-744e-656564454= 649"; >> + >> /// Disk management context. >> /// >> /// This provides access to disk information with some caching for fa= ster querying of multiple >> @@ -844,8 +847,8 @@ fn get_partitions_info( >> if let (Some(devpath), Some(infos)) =3D (devpath.as_ref()= , lsblk_infos.as_ref()) { >> for info in infos.iter().filter(|i| i.path.eq(devpath= )) { >> used =3D match info.partition_type.as_deref() { >> - Some("21686148-6449-6e6f-744e-656564454649") = =3D> PartitionUsageType::BIOS, >> - Some("c12a7328-f81f-11d2-ba4b-00a0c93ec93b") = =3D> PartitionUsageType::EFI, >> + Some(BIOS_PARTITION_TYPE) =3D> PartitionUsageT= ype::BIOS, >> + Some(EFI_PARTITION_TYPE) =3D> PartitionUsageTy= pe::EFI, >> Some("6a945a3b-1dd2-11b2-99a6-080020736631") = =3D> { >> PartitionUsageType::ZfsReserved >> } >> @@ -1080,6 +1083,12 @@ pub fn wipe_blockdev(disk: &Disk, worker: Arc) -> Result<(), Error> >> for disk_info in get_lsblk_info()?.iter() { >> if disk_info.path =3D=3D disk_path_str && disk_info.partition= _type.is_some() { >> is_partition =3D true; >> + if matches!( >> + disk_info.partition_type.as_deref(), >> + Some(EFI_PARTITION_TYPE) >> + ) { >> + bail!("You will not be able to boot if you wipe the EF= I partition."); >> + } >> } >> } >> > I skipped this one for now, see no real sense in singling this out, and = why should > one be forbidden to wipe the paritions of a hard-disk that one moved ove= r from another > system, where it was previously used for booting, or if one has to switc= h EFI partition > and wants to wipe the old one afterwards? > > I'd rather see: > - such special partitions get an extra, specific warning in the UI about= the > potential impact > - a force flag added, which then also passes that to wipedisk to be able= to > actually clear a disk that was in use sometimes > - the same then implemented for Proxmox VE > > > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel >