!oNSIfazDqEcwhcOjSL:matrix.org

disko

366 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko93 Servers

Load older messages


SenderMessageTime
10 Mar 2024
@sigmasquadron:matrix.orgSigmaSquadron Hi all. Is there a way to create a partitionless LUKS device with Disko? All of the examples in the repo are putting the LUKS volume inside a GPT partition table, but since the LUKS volume will take up my entire disk, I would prefer to avoid partitioning the disk and only use LVM which takes the LUKS volumes as PVs. 14:53:42
@sigmasquadron:matrix.orgSigmaSquadronRedacted or Malformed Event14:57:18
@sigmasquadron:matrix.orgSigmaSquadron

I've tried using the following configuration, but it fails since it's missing the partition table type:

{
  disko.devices.disk."nvme0" = {
    type = "disk";
    device = "/dev/disk/by-id/nvme-ID";
    content = {
      luks = {
        size = "100%";
        content = {
          type = "luks2";
          name = "luks-0";
          passwordFile = "/tmp/disko/luks/nvme0.key";
          askPassword = false;
          extraFormatArgs = [
            "--cipher=aes-xts-plain64"
            "--hash=sha512"
            "--key-size=512"
            "--iter-time=5000"
            "--header=/dev/disk/by-id/usb-ID-part2"
          ];
          extraOpenArgs = [
            "--header=/dev/disk/by-id/usb-ID-part2"
          ];
          settings = {
            header = "/dev/disk/by-id/usb-ID-part2";
            preLVM = true;
            allowDiscards = true;
          };
          initrdUnlock = true;
          content = {
            type = "lvm_pv";
            vg = "NixOS";
          };
        };
      };
    };
  };
}
15:01:08
@lily:lily.flowersLily Foster
In reply to @sigmasquadron:matrix.org

I've tried using the following configuration, but it fails since it's missing the partition table type:

{
  disko.devices.disk."nvme0" = {
    type = "disk";
    device = "/dev/disk/by-id/nvme-ID";
    content = {
      luks = {
        size = "100%";
        content = {
          type = "luks2";
          name = "luks-0";
          passwordFile = "/tmp/disko/luks/nvme0.key";
          askPassword = false;
          extraFormatArgs = [
            "--cipher=aes-xts-plain64"
            "--hash=sha512"
            "--key-size=512"
            "--iter-time=5000"
            "--header=/dev/disk/by-id/usb-ID-part2"
          ];
          extraOpenArgs = [
            "--header=/dev/disk/by-id/usb-ID-part2"
          ];
          settings = {
            header = "/dev/disk/by-id/usb-ID-part2";
            preLVM = true;
            allowDiscards = true;
          };
          initrdUnlock = true;
          content = {
            type = "lvm_pv";
            vg = "NixOS";
          };
        };
      };
    };
  };
}
is luks2 a valid type? shouldn't it be just luks?
15:05:09
@sigmasquadron:matrix.orgSigmaSquadronRight, but even switching to just luks, the same error occurs, since it’s searching for the type in lib/types/table.nix15:06:28
@lily:lily.flowersLily Foster
In reply to @sigmasquadron:matrix.org
Right, but even switching to just luks, the same error occurs, since it’s searching for the type in lib/types/table.nix
hmmm it looks like disko supports luks as a content type for disk. one sec, let me poke at it
15:08:04
@lily:lily.flowersLily Foster
In reply to @sigmasquadron:matrix.org

I've tried using the following configuration, but it fails since it's missing the partition table type:

{
  disko.devices.disk."nvme0" = {
    type = "disk";
    device = "/dev/disk/by-id/nvme-ID";
    content = {
      luks = {
        size = "100%";
        content = {
          type = "luks2";
          name = "luks-0";
          passwordFile = "/tmp/disko/luks/nvme0.key";
          askPassword = false;
          extraFormatArgs = [
            "--cipher=aes-xts-plain64"
            "--hash=sha512"
            "--key-size=512"
            "--iter-time=5000"
            "--header=/dev/disk/by-id/usb-ID-part2"
          ];
          extraOpenArgs = [
            "--header=/dev/disk/by-id/usb-ID-part2"
          ];
          settings = {
            header = "/dev/disk/by-id/usb-ID-part2";
            preLVM = true;
            allowDiscards = true;
          };
          initrdUnlock = true;
          content = {
            type = "lvm_pv";
            vg = "NixOS";
          };
        };
      };
    };
  };
}

oh you're just missing type entirely. that's what's happening here (the disko test i just made for bare luks worked fine). try this:

{
  disko.devices.disk."nvme0" = {
    type = "disk";
    device = "/dev/disk/by-id/nvme-ID";
    content = {
      type = "luks";
      name = "luks-0";
      passwordFile = "/tmp/disko/luks/nvme0.key";
      askPassword = false;
      extraFormatArgs = [
        "--cipher=aes-xts-plain64"
        "--hash=sha512"
        "--key-size=512"
        "--iter-time=5000"
        "--header=/dev/disk/by-id/usb-ID-part2"
      ];
      extraOpenArgs = [
        "--header=/dev/disk/by-id/usb-ID-part2"
      ];
      settings = {
        header = "/dev/disk/by-id/usb-ID-part2";
        preLVM = true;
        allowDiscards = true;
      };
      initrdUnlock = true;
      content = {
        type = "lvm_pv";
        vg = "NixOS";
      };
    };
  };
}
15:19:45
@sigmasquadron:matrix.orgSigmaSquadronThat did indeed work. Thank you!15:23:20
11 Mar 2024
@fractivore:cyberia.club@fractivore:cyberia.club left the room.06:53:07
@wjjunyor:matrix.orgw joined the room.14:21:25
@thevilsol:matrix.orgVilsol joined the room.19:14:16
12 Mar 2024
@joerg:thalheim.ioMic92 raitobezarius: I had to solve a similar issue with disko-install now where disk at install time are different from boot 05:10:34
@joerg:thalheim.ioMic92Disko-install let's you re-assign disks: https://github.com/nix-community/disko/blob/master/docs/disko-install.md05:12:50
@joerg:thalheim.ioMic92Otherwise Disko's image creation Skript will also work.05:17:45
@joerg:thalheim.ioMic92https://github.com/nix-community/disko/blob/master/docs/reference.md#generating-the-raw-vm-image05:18:13
14 Mar 2024
@federicodschonborn:matrix.org@federicodschonborn:matrix.org left the room.02:04:52
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.18:44:18
16 Mar 2024
@grahamc:nixos.org@grahamc:nixos.org joined the room.00:00:50
17 Mar 2024
@sankaratupi:matrix.orgFelipe Marcelino joined the room.17:59:21
18 Mar 2024
@darkwater4213:matrix.orgdarkwater4213 joined the room.00:42:18
@common0r:matrix.orgcomm0n changed their display name from common0r to common.00:43:19
@common0r:matrix.orgcomm0n changed their profile picture.00:43:23
19 Mar 2024
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.00:29:45
@tcurdt:matrix.orgtcurdt joined the room.15:39:40
@spewdins:beeper.comspewdins joined the room.15:40:07
@mannp:mannuk.rocksmannp ⚡️ joined the room.19:13:12
@tcurdt:matrix.orgtcurdt so, I have run disko ... now I want to try a nixos-install --flake .
for that it seems like I have to add the disko config.
is that really required?
21:08:44
@bumperboat:matrix.orgbumperboatThe disko module configures the mount points (and lvm, luks, etc) in the nixosConfiguration. Otherwise you'll have to do it twice I'd think22:09:14
@bumperboat:matrix.orgbumperboat* The disko module configures the mount points (and lvm, luks, etc) in the nixosConfiguration. Otherwise you'll have to configure it twice I'd think22:10:08
@bumperboat:matrix.orgbumperboat set a profile picture.22:21:01

Show newer messages


Back to Room ListRoom Version: 10