diff --git a/src/cryptobox/core/blockdevice.py b/src/cryptobox/core/blockdevice.py index 8536520..5473cd8 100644 --- a/src/cryptobox/core/blockdevice.py +++ b/src/cryptobox/core/blockdevice.py @@ -389,8 +389,8 @@ class Blockdevice: default = 0 try: size_blocks = int(file(os.path.join(self.devdir, 'size')).read()) - ## size is defined as the number of blocks (512 byte) - return int(size_blocks/512) + ## size is defined as the number of blocks (512 byte each) + return int(size_blocks*512/1024/1024) except OSError: return default except ValueError: