I am using disko in combination with nixos-anywhere to install a VM on proxmox.
That has worked out nicely so far. Below is my config for that for reference, it is basically an exact copy of the disko example flake.
disko.devices = {
disk.disk1 = {
device = "/dev/vda";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [ "defaults" ];
};
};
};
};
};
};
I would now like to add a second drive to that VM.
I have already added an empty 1TB Drive through the proxmox webui on device virtio12 and I can see it as /dev/vdm when running lsblk.
I have added the following disko config for it:
disko.devices.disk.disk2 = {
device = "/dev/vdm";
type = "disk";
content = {
type = "gpt";
partitions = {
main = {
start = "1MiB";
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/storage";
};
};
};
};
};
When I apply that new configuration to my VM, it fails with Failed to start local-fs.target and the system does not finish booting anymore and enters emergency mode after A start job is running for /dev/disk/by-partlabel/disk-disk2-main times out.
Do I simply have an error in my partition setup, or do I have to create the mountpoint manually first? Or does disko not support formatting and mounting new disks on existing systems?