Skip to content

btrfs-space-calculator crashes with raid5 #19

@arvidjaar

Description

@arvidjaar
bor@bor-Latitude-E5450:~/src/python-btrfs$ git describe HEAD
v11
bor@bor-Latitude-E5450:~/src/python-btrfs$ ./bin/btrfs-space-calculator -m raid0 -d raid5 3T 1T 2T
Traceback (most recent call last):
  File "./bin/btrfs-space-calculator", line 189, in <module>
    main()
  File "./bin/btrfs-space-calculator", line 158, in main
    usage = btrfs.fs_usage.FsUsage(fs)
  File "/home/bor/src/python-btrfs/bin/btrfs/fs_usage.py", line 449, in __init__
    dev_extent_length = btrfs.volumes.chunk_to_dev_extent_length(chunk)
  File "/home/bor/src/python-btrfs/bin/btrfs/volumes.py", line 212, in chunk_to_dev_extent_length
    return chunk_length_to_dev_extent_length(chunk.type, chunk.num_stripes, chunk.length)
  File "/home/bor/src/python-btrfs/bin/btrfs/volumes.py", line 192, in chunk_length_to_dev_extent_length
    dev_extent_length = raw_data_bytes // num_data_stripes
ZeroDivisionError: integer division or modulo by zero
bor@bor-Latitude-E5450:~/src/python-btrfs$ ./bin/btrfs-space-calculator -m raid0 -d raid6 3T 1T 2T
Target metadata profile: RAID0
Target data profile: RAID6
Mixed block groups: False
Total raw filesystem size: 5.46TiB
Device sizes:
  Device 1: 2.73TiB
  Device 2: 931.32GiB
  Device 3: 1.82TiB
Metadata to data ratio: 1:200
Estimated virtual space to use for metadata: 5.00GiB
Estimated virtual space to use for data: 929.66GiB
Total unallocatable raw amount: 2.73TiB
Unallocatable raw bytes per device:
  Device 1: 1.82TiB
  Device 2: 0.00B
  Device 3: 931.32GiB
bor@bor-Latitude-E5450:~/src/python-btrfs$ 

It does not matter whether I use raid5 for data or metadata. Other profiles seem to work after quick testing.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions