disk_layout: optimize btrfs filesystem overhead

The defaults already give more space than the ext4 defaults but it's
recommended to use the mixed mode for filesystems smaller than 1-5 GB.
Another aspect is the duplication of metadata and while it currently is
off it's actually related to the underlying block device and could
change as soon as the block device type changes.

Select the mixed mode that uses a merged area for data and metadata
blocks. Also ensure that no metadata duplication gets enabled
automatically.
This commit is contained in:
Kai Lüke 2021-07-27 14:23:47 +02:00
parent bc97e15c3c
commit e4f811dd0d

View File

@ -364,7 +364,7 @@ def FormatBtrfs(part, device):
part: dict defining the partition
device: name of the block device to format
"""
cmd = ['mkfs.btrfs', '--byte-count', part['fs_bytes']]
cmd = ['mkfs.btrfs', '--mixed', '-m', 'single', '-d', 'single', '--byte-count', part['fs_bytes']]
if 'fs_label' in part:
cmd += ['--label', part['fs_label']]
Sudo(cmd + [device])