!oNSIfazDqEcwhcOjSL:matrix.org

disko

356 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko89 Servers

Load older messages


SenderMessageTime
22 May 2025
@lotte:chir.rs@lotte:chir.rsfor systemd initrds this one seems to work around it: https://git.chir.rs/darkkirb/nixos-config/raw/branch/main/modules/bcachefs.nix16:34:44
@horyzon7:matrix.orghoryzon7 joined the room.22:16:42
@horyzon7:matrix.orghoryzon7

hi all, Im attempting to use disko to replicate the partitioning and formatting steps as described by the nixos manual

this is what I have so far

{ device ? throw, …}: {
  disko.devices = {
    disk = {
      main = {
        inherit device;
        type = “disk”;
        content = {
          type = “gpt”;
          partitions = {
            root = {
              start = “512MiB”;
              end = “-16GiB”;
              content = {
                type = “filesystem”;
                format = “ext4”;
                mountpoint = “/“;
              };
            };
            swap = {
              start = “-16GiB”;
              end = “100%”;
              content = {
                type = “swap”;
                resumeDevice = true;
              };
            };
            ESP = {
              type = “EF00”;
              start = “1MiB”;
              end = “512MiB”;
              content = {
                type = “filesystem”;
                format = “vfat”;
                mountpoint = “/boot”;
                mountOptions = [ “umask=0077” ];
              };
            };
          };
        };
      };
    };
  };
}

sorry for any typos, Im literally having to copy this from the tty

evidently, the above did not work with nix —experimental-features “nix-command flakes” run github:nix-community/disko/latest — —mode destroy,format,mount ./modules/disko-config.nix —arg device ‘“/dev/nvme1n1”’

I got an error that I will try to get word-for-word here (I cant quite yet get it, because I cant scroll in tty and havent used a pager yet)

but the error was related to “cannot create name disk-main-root”, and then “cannot set code 8300”

22:32:13
@horyzon7:matrix.orghoryzon7let me try getting the exact error, one second22:32:22
@horyzon7:matrix.orghoryzon7 Unable to set partition 2’s name to ‘disk-main-root’!
Could not change partition 2’s type code to 8300!
22:33:25
@horyzon7:matrix.orghoryzon7could anyone help me with?22:33:54
@horyzon7:matrix.orghoryzon7again, im just trying to replicate the steps from the nixos manual (https://nixos.org/manual/nixos/stable/#sec-installation)22:34:59
@horyzon7:matrix.orghoryzon7

i’ve also tried adding name = “root” under root = {, but that also did not solve

for some reason, disko is running sgdisk with the flag —change-name=2:disk-main-root instead of the appropriate name that I’m trying to specify by adding name = “root”

22:49:04
@horyzon7:matrix.orghoryzon7 for reference, an ls into /dev/disk/by-partlabel when following the instructions (https://nixos.org/manual/nixos/stable/#sec-installation-manual-partitioning-UEFI) gives ESP root swap, but the above disko config is giving me a disk-main-ESP, as is expected by the erroneous switch of sgdisk 23:00:24
@horyzon7:matrix.orghoryzon7 im noticing the same behavior with simple.efi (https://raw.githubusercontent.com/nix-community/disko/refs/heads/master/example/simple-efi.nix) 23:27:04
23 May 2025
@lassulus:lassul.uslassulusit seems the end of your ESP partition is on the same block as your root partition07:08:30
@lassulus:lassul.uslassulusand it's end overlaps with the swap partition07:08:40
@lassulus:lassul.uslassulusif you want to override the label, you need to set label on the partition07:08:54
@disco_stick:matrix.orgfood style edible product changed their display name from SS Bullshit Dreams to Mena, AR.14:26:16
@horyzon7:matrix.orghoryzon7

so, concretely, I need to use a label = “…”; for each partition.

also, how does my ESP partition overflow into my other partitions? the only way that I can think of is if end = is inclusive (rather than exclusive), which would be weird.

so you’re saying that both start= and end= are inclusive?

18:30:01
@horyzon7:matrix.orghoryzon7I say its weird because this how we make the partitions according to the nixos manual mkpart ESP fat32 1MB 512MB mkpart root ext4 512MB -8GB mkpart swap linux-swap -8GB 100%18:31:29
@horyzon7:matrix.orghoryzon7so I quite literally just attempted copying that18:31:40
@lassulus:lassul.uslassulusyes, they are sadly inclusive, not sure why sgdisk was built that way :D18:33:05
@lassulus:lassul.uslassulusthats why I usually leave start empty, because 0 will pick the next empty space18:33:32
@horyzon7:matrix.orghoryzon7ah so its sgdisk’s fault. alright, thanks!18:33:52
@lassulus:lassul.uslassulusI thought about different ways to fix that in disko, but nothing good comes to mind, maybe there is a way to do a 1 block addition in the specification? but on my last search I didn't find anything18:35:05
24 May 2025
@sss:matrix.dark-alexandr.netsss joined the room.13:01:58
@rp6667:matrix.orgrow joined the room.14:28:29
@disco_stick:matrix.orgfood style edible product changed their display name from Mena, AR to SS Bullshit Dreams.17:25:10
@disco_stick:matrix.orgfood style edible product changed their display name from SS Bullshit Dreams to SSBSD.17:25:21
25 May 2025
@nicoty:kde.orgnicoty Hello. I'm trying to set up a VM using a flake and disko, but the flake fails to build due to an sgdisk error ("Could not create partition 1"). What am I doing wrong? 22:26:30
@lassulus:lassul.uslassulusyou need to set imageSize on the disk type22:34:37
@lassulus:lassul.uslassulusthe default is just 2G22:34:48
@nemnix:matrix.org@nemnix:matrix.org left the room.22:41:07
@nicoty:kde.orgnicoty
In reply to @lassulus:lassul.us
you need to set imageSize on the disk type
Thank you, I'll give it a shot!
22:50:33

Show newer messages


Back to Room ListRoom Version: 10