From 0e206d9f051d735b49900369e6603e78cbfae481 Mon Sep 17 00:00:00 2001 From: Agnieszka Kostrzewa Date: Sat, 21 Apr 2012 21:03:26 +0200 Subject: [PATCH] More user friendly pmount/pumount fails. --- qubesmanager/backup_utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qubesmanager/backup_utils.py b/qubesmanager/backup_utils.py index 368b546..3c1752c 100644 --- a/qubesmanager/backup_utils.py +++ b/qubesmanager/backup_utils.py @@ -51,7 +51,7 @@ def mount_device(dev_path): pmount_cmd = [mount_for_backup_path, dev_path, mount_dir_name] res = subprocess.check_call(pmount_cmd) except Exception as ex: - QMessageBox.warning (None, "Error mounting selected device!", "ERROR: {0}".format(ex)) + QMessageBox.warning (None, "Error mounting selected device!", "Could not mount {0}.

ERROR: {1}".format(dev_path, ex)) return None if res == 0: dev_mount_path = "/media/"+mount_dir_name @@ -60,12 +60,14 @@ def mount_device(dev_path): def umount_device(dev_mount_path): try: - pumount_cmd = ["pumount", dev_mount_path] + pumount_cmd = ["pumount", "--luks-force", dev_mount_path] res = subprocess.check_call(pumount_cmd) if res == 0: dev_mount_path = None except Exception as ex: - QMessageBox.warning (None, "Could not unmount backup device!", "ERROR: {0}".format(ex)) + QMessageBox.warning (None, "Error unmounting backup device!", "Could not unmount {0}.
\ + Please unmount it manually using
pumount {0}.

\ + ERROR: {1}".format(dev_mount_path, ex)) return dev_mount_path