summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/mkfs.btrfs.asciidoc16
-rw-r--r--utils.c10
2 files changed, 20 insertions, 6 deletions
diff --git a/Documentation/mkfs.btrfs.asciidoc b/Documentation/mkfs.btrfs.asciidoc
index 98fe694b..7d19a146 100644
--- a/Documentation/mkfs.btrfs.asciidoc
+++ b/Documentation/mkfs.btrfs.asciidoc
@@ -263,18 +263,26 @@ There are the following block group types available:
.2+^.<h| Profile 3+^.^h| Redundancy .2+^.<h| Min/max devices
^.^h| Copies ^.^h| Parity ^.<h| Striping
| single | 1 | | | 1/any
-| DUP | 2 / 1 device | | | 1/any ^(see note)^
+| DUP | 2 / 1 device | | | 1/any ^(see note 1)^
| RAID0 | | | 1 to N | 2/any
| RAID1 | 2 | | | 2/any
| RAID10 | 2 | | 1 to N | 4/any
-| RAID5 | 1 | 1 | 2 to N - 1 | 2/any
-| RAID6 | 1 | 2 | 3 to N - 2 | 3/any
+| RAID5 | 1 | 1 | 2 to N - 1 | 2/any ^(see note 2)^
+| RAID6 | 1 | 2 | 3 to N - 2 | 3/any ^(see note 3)^
|=============================================================
-'Note:' DUP may exist on more than 1 device if it starts on a single device and
+'Note 1:' DUP may exist on more than 1 device if it starts on a single device and
another one is added. Since version 4.5.1, *mkfs.btrfs* will let you create DUP
on multiple devices.
+'Note 2:' It's not recommended to use 2 devices with RAID5. In that case,
+parity stripe will contain the same data as the data stripe, making RAID5
+degraded to RAID1 with more overhead.
+
+'Note 3:' It's also not recommended to use 3 devices with RAID6, unless you
+want to get effectively 3 copies in a RAID1-like manner (but not exactly that).
+N-copies RAID1 is not implemented.
+
DUP PROFILES ON A SINGLE DEVICE
-------------------------------
diff --git a/utils.c b/utils.c
index cec7c738..a31840eb 100644
--- a/utils.c
+++ b/utils.c
@@ -3280,6 +3280,7 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
u64 dev_cnt, int mixed, int ssd)
{
u64 allowed = 0;
+ u64 profile = metadata_profile | data_profile;
switch (dev_cnt) {
default:
@@ -3294,8 +3295,7 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
allowed |= BTRFS_BLOCK_GROUP_DUP;
}
- if (dev_cnt > 1 &&
- ((metadata_profile | data_profile) & BTRFS_BLOCK_GROUP_DUP)) {
+ if (dev_cnt > 1 && profile & BTRFS_BLOCK_GROUP_DUP) {
warning("DUP is not recommended on filesystem with multiple devices");
}
if (metadata_profile & ~allowed) {
@@ -3315,6 +3315,12 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
return 1;
}
+ if (dev_cnt == 3 && profile & BTRFS_BLOCK_GROUP_RAID6) {
+ warning("RAID6 is not recommended on filesystem with 3 devices only");
+ }
+ if (dev_cnt == 2 && profile & BTRFS_BLOCK_GROUP_RAID5) {
+ warning("RAID5 is not recommended on filesystem with 2 devices only");
+ }
warning_on(!mixed && (data_profile & BTRFS_BLOCK_GROUP_DUP) && ssd,
"DUP may not actually lead to 2 copies on the device, see manual page");