From 04dbadea3b329d1977b2fc64afc4eaf7f67d3368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Wed, 14 Jul 2021 21:28:12 +0200 Subject: [PATCH] disk_layout: use btrfs for the /usr partition The compression feature of btrfs allows us to store more in the size-limited /usr and OEM partitions. The size should of course still be monitored to not bloat the image but more headroom helps to try things out quickly without hitting the hard limit which fails the build. Use btrfs with zstd compression for the /usr partition. While for ext2 a hack exists to force read-only mounts by manipulating some bytes of the filesystem, on btrfs we can use the subvolume read-only flag instead which also works for the default top level subvolume. However, it also makes also sense to mount the filesystem with the "norecovery" mount option to prevent any write attempts even when the "ro" option is set (not needed when using dm-verity in read-only mode but when directly mounting without dm-verity). A new subvolumes is not created because subvolumes don't offer anything special as long as we use the A/B partition update mechanism (but they could be an alternative for that). Note that switching to the btrfs on the /usr partition is only possible when the Flatcar Stable release has all patches in update-engine and seismograph's rootdev. --- build_library/disk_layout.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build_library/disk_layout.json b/build_library/disk_layout.json index 96cb594dcf..5d90ccc6c6 100644 --- a/build_library/disk_layout.json +++ b/build_library/disk_layout.json @@ -29,7 +29,8 @@ "type":"flatcar-rootfs", "blocks":"2097152", "fs_blocks":"260094", - "fs_type":"ext2", + "fs_type":"btrfs", + "fs_compression":"zstd", "mount":"/usr", "features": ["prioritize", "verity"] },