Пример #1
0
def get_size(device_path):
    block_count = tune2fs.get_info(device_path, "Block count")
    block_size = tune2fs.get_info(device_path, "Block size")

    if block_count is None or block_size is None:
        return None

    size = int(block_count) * int(block_size)
    return size
Пример #2
0
def get_free_size(device_path):
    free_blocks = tune2fs.get_info(device_path, "Free blocks")
    block_size = tune2fs.get_info(device_path, "Block size")

    if free_blocks is None or block_size is None:
        return None

    size = int(free_blocks) * int(block_size)
    return size
Пример #3
0
def get_free_blocks(device_path):
    free_blocks = tune2fs.get_info(device_path, "Free blocks")
    if free_blocks is not None:
        free_blocks = int(free_blocks)

    return free_blocks
Пример #4
0
def get_uuid(device_path):
    uuid = tune2fs.get_info(device_path, "Filesystem UUID")
    return uuid