diff --git a/src/cryptobox/core/blockdevice.py b/src/cryptobox/core/blockdevice.py index 5473cd8..ada7024 100644 --- a/src/cryptobox/core/blockdevice.py +++ b/src/cryptobox/core/blockdevice.py @@ -573,6 +573,10 @@ class Blockdevice: LOGGER.warning("Failed to call '%s' to determine UUID: %s" % \ (prefs["Programs"]["blkid"], err_msg)) return None + if proc.returncode == 2: + ## the device does not contain a filesystem (e.g. it is zeroed or + ## it contains a partition table) + return None if proc.returncode != 0: LOGGER.warning("Execution of '%s' for '%s' failed: %s" % \ (prefs["Programs"]["blkid"], self.devnodes[0], @@ -612,6 +616,10 @@ class Blockdevice: % prefs["Programs"]["blkid"] + "'%s': %s" % \ (self.devnodes[0], err_msg)) return None + if proc.returncode == 2: + ## the device does not contain a filesystem (e.g. it is zeroed or + ## it contains a partition table) + return None if proc.returncode != 0: LOGGER.warning("Execution of '%s' for '%s' failed: %s" % \ (prefs["Programs"]["blkid"], self.devnodes[0], @@ -652,6 +660,10 @@ class Blockdevice: % prefs["Programs"]["blkid"] + " '%s': %s" % \ (self.devnodes[0], err_msg)) return None + if proc.returncode == 2: + ## the device does not contain a filesystem (e.g. it is zeroed or + ## it contains a partition table) + return None if proc.returncode != 0: LOGGER.warning("Execution of '%s' for '%s' failed: %s" % \ (prefs["Programs"]["blkid"], self.devnodes[0],