Skip to content

top-level option for btrfs multi-device volume #261

Open
@montchr

Description

@montchr

Context

I am looking to implement a layout composed of two NVMe devices, similar to the following example:

https://github.com/tfc/nixos-anywhere-example/blob/fd710be5255931a64a9efb9c15c9b36e6011e7b4/two-raids-on-two-disks.nix

In contrast to that example, I would like to use BTRFS' native support for multi-device volumes instead of using mdadm:

mkfs.btrfs --force \
  --label nixos \
  --data single \
  --metadata raid1 \
  "${NVME01}p3" \
  "${NVME02}p3"

Problem

I would expect to be able to configure subvolumes for a multi-device BTRFS volume at disko.devices.btrfs (or some more-fitting name) in the same way that other volume-like domains e.g. mdadm, zpool do:

disko/lib/default.nix

Lines 306 to 334 in 5d9f362

devices = lib.types.submodule {
options = {
disk = lib.mkOption {
type = lib.types.attrsOf diskoLib.types.disk;
default = { };
description = "Block device";
};
mdadm = lib.mkOption {
type = lib.types.attrsOf diskoLib.types.mdadm;
default = { };
description = "mdadm device";
};
zpool = lib.mkOption {
type = lib.types.attrsOf diskoLib.types.zpool;
default = { };
description = "ZFS pool device";
};
lvm_vg = lib.mkOption {
type = lib.types.attrsOf diskoLib.types.lvm_vg;
default = { };
description = "LVM VG device";
};
nodev = lib.mkOption {
type = lib.types.attrsOf diskoLib.types.nodev;
default = { };
description = "A non-block device";
};
};
};

While similar to #99, this problem pertains more to first-class BTRFS support with a top-level option. Such an option was suggested in #99 (comment) but the issue was closed shortly thereafter.

Question

Is it currently possible to configure multi-device BTRFS subvolumes using Disko?

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributions welcomeThere's nothing left to discuss, feel free to submit a PR for this!enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions