Skip to content

Commit

Permalink
Introduce new disk partitioning scheme
Browse files Browse the repository at this point in the history
New disk configuration provides grounds for upcoming features,
such as AB software updates and Storage VM and many more.

Signed-off-by: Ivan Nikolaenko <ivan.nikolaenko@unikie.com>
  • Loading branch information
unbel13ver committed Feb 21, 2024
1 parent 4b892d0 commit af1d8c7
Showing 1 changed file with 117 additions and 9 deletions.
126 changes: 117 additions & 9 deletions templates/targets/x86_64/generic/disk-config.nix
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -14,8 +14,8 @@ _: {
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
esp_a = {
name = "ESP_A";
size = "500M";
type = "EF00";
content = {
Expand All @@ -25,23 +25,43 @@ _: {
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";
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
root_a = {
size = "50G";
content = {
type = "filesystem";
format = "ext4";
Expand All @@ -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"
];
};
};
};
};
};
Expand Down

0 comments on commit af1d8c7

Please sign in to comment.