[pbs-devel] [PATCH proxmox-backup 6/6] prohibit disk wipe of EFI partition
Markus Frank
m.frank at proxmox.com
Fri Nov 10 14:50:10 CET 2023
Signed-off-by: Markus Frank <m.frank at 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")
+ ) {
+ bail!("You will not be able to boot if you wipe the EFI partition.");
+ }
}
}
--
2.39.2
More information about the pbs-devel
mailing list