From 25274614f9698e5eefbe5f2c6254e7d3b1337c10 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Fri, 12 Jul 2024 11:33:27 -0400 Subject: [PATCH] Use proper filesystem creation flag for btrfs mkfs.btrfs uses a lower case f to force the overwrite of any existing fs. Set the proper option for this use case. Fixes #2849 --- azurelinuxagent/daemon/resourcedisk/default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurelinuxagent/daemon/resourcedisk/default.py b/azurelinuxagent/daemon/resourcedisk/default.py index df4bb76f8c..d23bc2fab4 100644 --- a/azurelinuxagent/daemon/resourcedisk/default.py +++ b/azurelinuxagent/daemon/resourcedisk/default.py @@ -124,7 +124,7 @@ def mount_resource_disk(self, mount_point): "{0}: {1}".format(device, ret[1])) force_option = 'F' - if self.fs == 'xfs': + if self.fs in ('btrfs', 'xfs'): force_option = 'f' mkfs_string = "mkfs.{0} -{2} {1}".format( self.fs, partition, force_option)