From e4f811dd0db29f445f4d708c0a6105d424a19a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Tue, 27 Jul 2021 14:23:47 +0200 Subject: [PATCH] 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. --- build_library/disk_util | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_library/disk_util b/build_library/disk_util index de5e14748f..267ebb32ac 100755 --- a/build_library/disk_util +++ b/build_library/disk_util @@ -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])