Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkfs.btrfs shouldn't always use data profile 'raid0' by default with multiple devices #270

Open
cmurf opened this issue Jul 11, 2020 · 4 comments
Labels
Milestone

Comments

@cmurf
Copy link

@cmurf cmurf commented Jul 11, 2020

# uname -r
5.8.0-0.rc3.20200701git7c30b859a947.1.fc33.x86_64
# btrfs --version
btrfs-progs v5.7

mkfs.btrfs defaults to data profile 'raid0' even when the devices are completely unlike size.
(a) mkfs.btrfs should use some threshold, maybe 5% difference, by default. If the difference is less than threshold, use 'raid0'. If more than threshold, use 'single'.
(b) mkfs.btrfs should use 'single' profile by default.

The current behavior makes it way too easy (as in, by default) to run into the following two bugs:
#269
https://bugzilla.redhat.com/show_bug.cgi?id=1855174

@kdave
Copy link
Owner

@kdave kdave commented Jul 11, 2020

Yeah, I agree, raid0 was bad choice for a default. For multiple devices there are also multiple choices about the striping and parity so I guess most users set that explicitly, but the defaults should be something sane anyway. It's much easier to convert from single than from raid0.

@kdave kdave added this to the v5.7.1 milestone Jul 11, 2020
@kdave kdave added the enhancement label Jul 11, 2020
@kdave kdave modified the milestones: v5.7.1, v5.8 Jul 17, 2020
@kdave
Copy link
Owner

@kdave kdave commented Jul 17, 2020

Changes to defaults need to be done at major releases, I'm tagging this for 5.8.

@cmurf
Copy link
Author

@cmurf cmurf commented Jul 20, 2020

Related downstream bug has been accepted as release blocking for beta. Ideally a fix lands by Aug 25.
https://bugzilla.redhat.com/show_bug.cgi?id=1855174#c19

kdave added a commit that referenced this issue Jul 21, 2020
…evices

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>
@kdave
Copy link
Owner

@kdave kdave commented Jul 21, 2020

Pushed to devel. The 5.8 is roughly scheduled to kernel 5.8 release (maybe 2 weeks from now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.