Fix 2496 - umounting all partitions (#2498)

* Fix 2496 - umounting all partitions

* Update
This commit is contained in:
Daniel Girtler 2024-05-15 20:47:20 +10:00 committed by GitHub
parent 06baa08750
commit bab06e4d75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 9 deletions

View File

@ -650,9 +650,6 @@ class DeviceHandler(object):
if partition_table.MBR and len(modification.partitions) > 3:
raise DiskError('Too many partitions on disk, MBR disks can only have 3 primary partitions')
# make sure all devices are unmounted
self.umount_all_existing(modification.device_path)
# WARNING: the entire device will be wiped and all data lost
if modification.wipe:
self.wipe_dev(modification.device)

View File

@ -58,6 +58,10 @@ class FilesystemHandler:
if SysInfo.has_uefi() is False:
partition_table = PartitionTable.MBR
# make sure all devices are unmounted
for mod in device_mods:
device_handler.umount_all_existing(mod.device_path)
for mod in device_mods:
device_handler.partition(mod, partition_table=partition_table)
@ -97,9 +101,6 @@ class FilesystemHandler:
self._validate_partitions(create_or_modify_parts)
# make sure all devices are unmounted
device_handler.umount_all_existing(device_path)
for part_mod in create_or_modify_parts:
# partition will be encrypted
if self._enc_config is not None and part_mod in self._enc_config.partitions:
@ -312,9 +313,6 @@ class FilesystemHandler:
self._validate_partitions(filtered_part)
# make sure all devices are unmounted
device_handler.umount_all_existing(mod.device_path)
enc_mods = {}
for part_mod in filtered_part: