From 3161cd8afff2def3d4d3057cb028c666c4db55a3 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 29 Mar 2021 09:09:25 +0200 Subject: Fixing rare occation where partitions dissapear just before .format(). --- archinstall/lib/disk.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'archinstall') diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index 85b08bc0..9afece2e 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -270,6 +270,11 @@ class Partition(): if allow_formatting is None: allow_formatting = self.allow_formatting + # To avoid "unable to open /dev/x: No such file or directory" + start_wait = time.time() + while pathlib.Path(path).exists() is False and time.time() - start_wait < 10: + time.sleep(0.025) + if not allow_formatting: raise PermissionError(f"{self} is not formatable either because instance is locked ({self.allow_formatting}) or a blocking flag was given ({allow_formatting})") -- cgit v1.2.3-54-g00ecf