diff --git a/lvmsnapshot.py b/lvmsnapshot.py index 29adae37bf956a69548cc4fc92e8cdb0640038e1..c2145b59c406f843d04f6ad9c7bbaf60c37fc92b 100644 --- a/lvmsnapshot.py +++ b/lvmsnapshot.py @@ -264,12 +264,15 @@ class Snapshot: def remove(self): logging.debug("removing snapshot {}".format(self.get_name())) - self.unmount() - remove_command = [ - "/sbin/lvremove", - self.get_full_volume() - ] - run_process(remove_command, check=True) + try: + self.unmount() + remove_command = [ + "/sbin/lvremove", + self.get_full_volume() + ] + run_process(remove_command, check=True) + except sp.CalledProcessError: + logging.warn("Removing {} failed".format(self.get_name())) def unmount(self): logging.debug("unmounting snapshot {}".format(self.get_name()))