mirror of
https://github.com/nix-community/disko.git
synced 2024-09-10 22:15:54 +03:00
example: add mdadm-raid0
This commit is contained in:
parent
79785c1cfc
commit
be98cffef0
65
example/mdadm-raid0.nix
Normal file
65
example/mdadm-raid0.nix
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
vdb = {
|
||||
type = "disk";
|
||||
device = "/dev/my-disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02"; # for grub MBR
|
||||
};
|
||||
mdadm = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
vdc = {
|
||||
type = "disk";
|
||||
device = "/dev/my-disk2";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02"; # for grub MBR
|
||||
};
|
||||
mdadm = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
mdadm = {
|
||||
raid0 = {
|
||||
type = "mdadm";
|
||||
level = 0;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
primary = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
13
tests/mdadm-raid0.nix
Normal file
13
tests/mdadm-raid0.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, diskoLib ? pkgs.callPackage ../lib { }
|
||||
}:
|
||||
diskoLib.testLib.makeDiskoTest {
|
||||
inherit pkgs;
|
||||
name = "mdadm-raid0";
|
||||
disko-config = ../example/mdadm-raid0.nix;
|
||||
extraTestScript = ''
|
||||
machine.succeed("test -b /dev/md/raid0");
|
||||
machine.succeed("mountpoint /");
|
||||
'';
|
||||
efi = false;
|
||||
}
|
Loading…
Reference in New Issue
Block a user