diff --git a/templates/targets/x86_64/generic/disk-config.nix b/templates/targets/x86_64/generic/disk-config.nix index ea0ee5de3e..11d3faedca 100644 --- a/templates/targets/x86_64/generic/disk-config.nix +++ b/templates/targets/x86_64/generic/disk-config.nix @@ -1,6 +1,6 @@ -# Copyright 2022-2023 TII (SSRC) and the Ghaf contributors +# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors # SPDX-License-Identifier: Apache-2.0 -# Example to create a bios compatible gpt partition +# _: { disko.devices = { disk.disk1 = { @@ -14,8 +14,8 @@ _: { size = "1M"; type = "EF02"; }; - esp = { - name = "ESP"; + esp_a = { + name = "ESP_A"; size = "500M"; type = "EF00"; content = { @@ -25,14 +25,34 @@ _: { mountOptions = ["umask=0077"]; }; }; - root = { - name = "root"; - size = "100%"; + esp_b = { + name = "ESP_B"; + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountOptions = ["umask=0077"]; + }; + }; + # LVM pool that is going to be encrypted + other_1 = { + name = "lvm_pv_1"; + size = "250G"; content = { type = "lvm_pv"; vg = "pool"; }; }; + # LVM pool that is going to be passed to the Storage VM + other_2 = { + name = "lvm_pv_2"; + size = "100%"; + content = { + type = "lvm_pv"; + vg = "vmstore"; + }; + }; }; }; }; @@ -40,8 +60,8 @@ _: { pool = { type = "lvm_vg"; lvs = { - root = { - size = "100%FREE"; + root_a = { + size = "50G"; content = { type = "filesystem"; format = "ext4"; @@ -51,6 +71,94 @@ _: { ]; }; }; + vm_storage_a = { + size = "30G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/vmstore"; + mountOptions = [ + "defaults" + ]; + }; + }; + reserved_a = { + size = "10G"; + content = { + type = "filesystem"; + format = "ext4"; + mountOptions = [ + "defaults" + ]; + }; + }; + root_b = { + size = "50G"; + content = { + type = "filesystem"; + format = "ext4"; + mountOptions = [ + "defaults" + ]; + }; + }; + vm_storage_b = { + size = "30G"; + content = { + type = "filesystem"; + format = "ext4"; + mountOptions = [ + "defaults" + ]; + }; + }; + reserved_b = { + size = "10G"; + content = { + type = "filesystem"; + format = "ext4"; + mountOptions = [ + "defaults" + ]; + }; + }; + gp_storage = { + # general purpose storage + size = "50G"; + content = { + type = "filesystem"; + format = "ext4"; + mountOptions = [ + "defaults" + ]; + }; + }; + recovery = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + vmstore = { + # Dedicated partition for StorageVM + type = "lvm_vg"; + lvs = { + storagevm = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountOptions = [ + "defaults" + ]; + }; + }; }; }; };