all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>, Markus Frank <m.frank@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 6/6] prohibit disk wipe of EFI partition
Date: Mon, 27 Nov 2023 17:29:11 +0100	[thread overview]
Message-ID: <a30b5362-b150-4cdb-a8bf-b99d89216424@proxmox.com> (raw)
In-Reply-To: <20231110135010.106015-6-m.frank@proxmox.com>



On 11/10/23 14:50, Markus Frank wrote:
> Signed-off-by: Markus Frank <m.frank@proxmox.com>
> ---
> 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?
> 
>   src/tools/disks/mod.rs | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/src/tools/disks/mod.rs b/src/tools/disks/mod.rs
> index 75d84696..8a28159e 100644
> --- a/src/tools/disks/mod.rs
> +++ b/src/tools/disks/mod.rs
> @@ -1071,6 +1071,12 @@ pub fn wipe_blockdev(disk: &Disk) -> Result<(), Error> {
>       for disk_i in get_lsblk_info()?.iter() {
>           if disk_i.path == disk_path.to_str().unwrap() && disk_i.partition_type.is_some() {
>               is_partition = true;
> +            if matches!(
> +                disk_i.partition_type.as_deref(),
> +                Some("c12a7328-f81f-11d2-ba4b-00a0c93ec93b")
Maybe add some comment on what this magic string means, e.g. with
a link to some spec that defines that?
Could also extract the string into a local constant with a good name 
(e.g. EFI_PARTITION_TYPE, or something alike),
that would maybe be a bit nicer to read.

> +            ) {
> +                bail!("You will not be able to boot if you wipe the EFI partition.");
> +            }
>           }
>       }
>   

-- 
- Lukas




  reply	other threads:[~2023-11-27 16:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10 13:50 [pbs-devel] [PATCH proxmox-backup 1/6] feature #3690: add regex, format & schema for partition names to pbs-api-types Markus Frank
2023-11-10 13:50 ` [pbs-devel] [PATCH proxmox-backup 2/6] feature #3690: add wipe_blockdev & change_parttype rust equivalent Markus Frank
2023-11-27 16:29   ` Lukas Wagner
2023-11-10 13:50 ` [pbs-devel] [PATCH proxmox-backup 3/6] feature #3690: api: add function wipe_disk Markus Frank
2023-11-10 13:50 ` [pbs-devel] [PATCH proxmox-backup 4/6] feature #3690: cli: " Markus Frank
2023-11-10 13:50 ` [pbs-devel] [PATCH proxmox-backup 5/6] feature #3690: ui: enable wipe disk in StorageAndDisks Markus Frank
2023-11-27 16:29   ` Lukas Wagner
2023-11-10 13:50 ` [pbs-devel] [PATCH proxmox-backup 6/6] prohibit disk wipe of EFI partition Markus Frank
2023-11-27 16:29   ` Lukas Wagner [this message]
2023-11-27 16:29 ` [pbs-devel] [PATCH proxmox-backup 1/6] feature #3690: add regex, format & schema for partition names to pbs-api-types Lukas Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a30b5362-b150-4cdb-a8bf-b99d89216424@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=m.frank@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal