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

manuelly splitt metadata from other data #50

Open
Tuxist opened this issue Oct 4, 2023 · 4 comments
Open

manuelly splitt metadata from other data #50

Tuxist opened this issue Oct 4, 2023 · 4 comments

Comments

@Tuxist
Copy link

Tuxist commented Oct 4, 2023

when i use:
mkfs.btrfs -mraid1 /dev/sd[a,b] -dsingle /dev/sdc

why btrfs writes metadata on dev sdc that makes no sense.

i my case i would use ssd for metadata and a hdd for data.

after some questions in irc i have heard btrfs don't support but the tool gives no warning.

why i can change profiles seperatly between meta and data but not select the devices they have to use. so i think is a nonsense feature.

@kakra
Copy link

kakra commented Oct 4, 2023

There's a patch set for that feature. Because those patches are difficult to find and track, I collected them here:
kakra/linux#26

@kakra
Copy link

kakra commented Oct 4, 2023

Also, I think this is already discussed in #19

@Zygo
Copy link

Zygo commented Oct 4, 2023

A line could be added to the doc to clarify that there is no ordering between options and devices, so they have the same meaning in any order. Note that this is already stated in the synopsis:

mkfs.btrfs [options] <device> [<device>...]

Unfortunately that can't be strictly enforced as it would break any existing script that puts an option after a device name on the command line. There could be at most a warning message indicating this ordering of options is deprecated.

The synopsis for a mkfs.btrfs that had ordered device options would look like this instead:

mkfs.btrfs [global-options] [device-options] <device> [[device-options] <device>...]

The current behavior is that this:

mkfs.btrfs -mraid1 /dev/sda1 /dev/sdb1 -dsingle /dev/sdc1

is exactly identical to any of:

mkfs.btrfs -dsingle -mraid1 /dev/sda1 /dev/sdb1 /dev/sdc1
mkfs.btrfs -mraid1 -dsingle /dev/sda1 /dev/sdb1 /dev/sdc1
mkfs.btrfs /dev/sda1 /dev/sdb1 /dev/sdc1 -dsingle -mraid1 

-d and -m are global options that affect the first block groups created on the filesystem. All listed devices are used to create the filesystem using those profiles.

To clarify the proposed change in #19, to maintain compatibility, -d and -m should remain global mkfs.btrfs options, and new options should be introduced that explicitly introduce (and when present, enforce) ordered behavior:

# Permitted: -d and -m appear before ordered options --metadata-preferred and --data-only
mkfs.btrfs -dsingle -mraid1 --metadata-preferred /dev/sda1 /dev/sdb1 --data-only /dev/sdc1
# (sda1 and sdb1 are metadata-preferred, sdc1 is data-only)

# Rejected: -d appears after a device name and an ordered option was used
mkfs.btrfs -mraid1 --metadata-preferred /dev/sda1 /dev/sdb1 -dsingle --data-only /dev/sdc1

# Permitted:  -d and -m appear after a device name, but no ordered option used
mkfs.btrfs -mraid1 /dev/sda1 /dev/sdb1 -dsingle /dev/sdc1
# (a warning might be printed on stderr)

@kakra
Copy link

kakra commented Oct 4, 2023

To clarify the proposed change in #19, to maintain compatibility, -d and -m should remain global mkfs.btrfs options, and new options should be introduced that explicitly introduce (and when present, enforce) ordered behavior:

This is a cool idea to pre-fill the preference hint on creation. I like that.

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

No branches or pull requests

3 participants