diff --git a/diskutil.py b/diskutil.py index 588f4379..101ccb02 100644 --- a/diskutil.py +++ b/diskutil.py @@ -280,6 +280,9 @@ def getDiskDeviceSize(dev): return int(__readOneLineFile__("/sys/block/%s/device/block/size" % dev)) elif os.path.exists("/sys/block/%s/size" % dev): return int(__readOneLineFile__("/sys/block/%s/size" % dev)) + else: + raise Exception("%s not found as %s or %s" % (dev, "/sys/block/%s/device/block/size", + "/sys/block/%s/size")) def getDiskSerialNumber(dev): # For Multipath nodes return info about 1st slave