aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbackend/raw_write.py31
1 files changed, 26 insertions, 5 deletions
diff --git a/backend/raw_write.py b/backend/raw_write.py
index a44eabe..58417f9 100755
--- a/backend/raw_write.py
+++ b/backend/raw_write.py
@@ -244,11 +244,32 @@ class Dumper(object):
process = None
working= False
if rc != 0:
- self.return_state = False
- self.return_message = _("Error {} while doing persistent partition: {}").format(rc, errs.decode('utf-8'))
- logging.error(self.return_message)
- self.finished.set()
- return
+ if rc == 1:
+ # the error is Re-reading the partition table failed.: Device or resource busy
+ logging.error(_("Error {} while doing persistent partition: {}").format(rc, errs.decode('utf-8')))
+ logging.error(_("Try reloading partition table"))
+ p = Popen(["partprobe",target], stdin = PIPE, stderr=PIPE)
+ outs, errs = p.communicate()
+ working=True
+ while working:
+ time.sleep(0.5)
+ p.poll()
+ rc=p.returncode
+ if not (rc is None):
+ process = None
+ working= False
+ else:
+ self.return_state = False
+ self.return_message = _("Unable to reload the partition table: {}").format(errs.decode('utf-8'))
+ logging.error(self.return_message)
+ self.finished.set()
+ return
+ else:
+ self.return_state = False
+ self.return_message = _("Error {} while doing persistent partition: {}").format(rc, errs.decode('utf-8'))
+ logging.error(self.return_message)
+ self.finished.set()
+ return
logging.debug("New partition created")
self._progress = 25