Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-29 09:09:25 +0200
committerAnton Hvornum <anton@hvornum.se>2021-03-29 09:09:25 +0200
commit3161cd8afff2def3d4d3057cb028c666c4db55a3 (patch)
treee3326526283f28c3b9aebe0c9fff500be9dac0df /archinstall
parenta156f224a87a02d6b0f9a54eef2ce18e418e5187 (diff)
Fixing rare occation where partitions dissapear just before .format().
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk.py5
1 files changed, 5 insertions, 0 deletions
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})")