From 647f1e3bb234db3dfaa9c55ea9ba7214f285bab1 Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Sun, 21 Jan 2024 15:07:09 +1100 Subject: [PATCH] Fix 2337 --- archinstall/lib/disk/device_handler.py | 8 ++++---- archinstall/lib/disk/device_model.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py index fcf5201339..c6d22077c8 100644 --- a/archinstall/lib/disk/device_handler.py +++ b/archinstall/lib/disk/device_handler.py @@ -296,15 +296,15 @@ def format( the formatting functionality and in essence the support for the given filesystem. """ - # don't touch existing partitions - filtered_part = [p for p in device_mod.partitions if not p.exists()] + # only verify partitions that are being created or modified + create_or_modify_parts = [p for p in device_mod.partitions if p.is_create_or_modify()] - self._validate_partitions(filtered_part) + self._validate_partitions(create_or_modify_parts) # make sure all devices are unmounted self._umount_all_existing(device_mod.device_path) - for part_mod in filtered_part: + for part_mod in create_or_modify_parts: # partition will be encrypted if enc_conf is not None and part_mod in enc_conf.partitions: self._perform_enc_formatting( diff --git a/archinstall/lib/disk/device_model.py b/archinstall/lib/disk/device_model.py index 54b4932b44..d4563faa43 100644 --- a/archinstall/lib/disk/device_model.py +++ b/archinstall/lib/disk/device_model.py @@ -793,6 +793,9 @@ def exists(self) -> bool: def is_exists_or_modify(self) -> bool: return self.status in [ModificationStatus.Exist, ModificationStatus.Modify] + def is_create_or_modify(self) -> bool: + return self.status in [ModificationStatus.Create, ModificationStatus.Modify] + @property def mapper_name(self) -> Optional[str]: if self.dev_path: