sweettea / rpms / btrfs-progs

Forked from rpms/btrfs-progs 8 months ago
Clone
Blob Blame History Raw
From 5e76619fcda3d792b2cb188fc2d950c61d7ebf09 Mon Sep 17 00:00:00 2001
From: David Sterba <dsterba@suse.com>
Date: Tue, 21 Jul 2020 12:28:05 +0200
Subject: [PATCH 2/2] btrfs-progs: mkfs: switch to single as default profile
 for multiple-devices

The single profile is better suited as default for data on multiple
devices. Switch from RAID0 because:

- it's easier to convert to other profiles, as single consumes some
  chunks per device, but RAID0 has chunks on all devices regardless of
  the used space

- RAID0 has no redundancy and compared one disk failure affects many
  files due to striping, while with single the chances are a bit higher
  that complete files are stored on one device

- when the device sizes are not equal and not even close to equal, the
  maximum achievable size with RAID0 is size of the smallest device due
  to striping, with single it's the sum of all device sizes

The changed defaults could affect scripts and deployments that rely on
the old values, but given the number of possible profiles for multiple
devices let's hope that they're specified explicitly in majority of
cases.

Issue: #270
Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit f1507716c67e2d6012f1e7a0f1538d4f669faa23)
---
 mkfs/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/common.h b/mkfs/common.h
index 61969dcc..cc88db71 100644
--- a/mkfs/common.h
+++ b/mkfs/common.h
@@ -35,7 +35,7 @@
 #define BTRFS_MKFS_DEFAULT_META_ONE_DEVICE	BTRFS_BLOCK_GROUP_DUP
 #define BTRFS_MKFS_DEFAULT_META_ONE_DEVICE_SSD	0	/* SINGLE */
 
-#define BTRFS_MKFS_DEFAULT_DATA_MULTI_DEVICE	BTRFS_BLOCK_GROUP_RAID0
+#define BTRFS_MKFS_DEFAULT_DATA_MULTI_DEVICE	0	/* SINGLE */
 #define BTRFS_MKFS_DEFAULT_META_MULTI_DEVICE	BTRFS_BLOCK_GROUP_RAID1
 
 /*
-- 
2.26.2