def _get_device_size(device):
 size_file = FilePath('/sys/block/{}/size'.format(device))
 return (int(size_file.getContent()) * 512)

def _get_device_size ( device ) : size_file = FilePath ( '/sys/block/{}/size' . format ( device ) ) return ( int ( size_file . getContent ( ) ) * 512 )
helper function to fetch the size of given block device .