summaryrefslogtreecommitdiffstats
path: root/example/lvm-raid.nix
diff options
context:
space:
mode:
Diffstat (limited to 'example/lvm-raid.nix')
-rw-r--r--example/lvm-raid.nix50
1 files changed, 43 insertions, 7 deletions
diff --git a/example/lvm-raid.nix b/example/lvm-raid.nix
index 3c5ee69..9d0c9d7 100644
--- a/example/lvm-raid.nix
+++ b/example/lvm-raid.nix
@@ -1,16 +1,28 @@
-{
+{ disks ? [ "/dev/vdb" "/dev/vdc" ] }: {
disk = {
- vdb = {
+ one = {
type = "disk";
- device = "/dev/vdb";
+ device = builtins.elemAt disks 0;
content = {
type = "table";
format = "gpt";
partitions = [
{
+ name = "boot";
+ type = "partition";
+ start = "0";
+ end = "100M";
+ fs-type = "fat32";
+ bootable = true;
+ content = {
+ type = "mdraid";
+ name = "boot";
+ };
+ }
+ {
type = "partition";
name = "primary";
- start = "0%";
+ start = "100M";
end = "100%";
content = {
type = "lvm_pv";
@@ -20,17 +32,29 @@
];
};
};
- vdc = {
+ two = {
type = "disk";
- device = "/dev/vdc";
+ device = builtins.elemAt disks 1;
content = {
type = "table";
format = "gpt";
partitions = [
{
+ name = "boot";
+ type = "partition";
+ start = "0";
+ end = "100M";
+ fs-type = "fat32";
+ bootable = true;
+ content = {
+ type = "mdraid";
+ name = "boot";
+ };
+ }
+ {
type = "partition";
name = "primary";
- start = "0%";
+ start = "100M";
end = "100%";
content = {
type = "lvm_pv";
@@ -41,6 +65,18 @@
};
};
};
+ mdadm = {
+ boot = {
+ type = "mdadm";
+ level = 1;
+ metadata = "1.0";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ };
+ };
+ };
lvm_vg = {
pool = {
type = "lvm_vg";