| 10 Mar 2024 |
SigmaSquadron | 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 | Redacted or Malformed Event | 14:57:18 |
SigmaSquadron | 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 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 | Right, but even switching to just luks, the same error occurs, since it’s searching for the type in lib/types/table.nix | 15:06:28 |
Lily 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 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 | That did indeed work. Thank you! | 15:23:20 |
| 11 Mar 2024 |
| @fractivore:cyberia.club left the room. | 06:53:07 |
| w joined the room. | 14:21:25 |
| Vilsol joined the room. | 19:14:16 |
| 12 Mar 2024 |
Mic92 | raitobezarius: I had to solve a similar issue with disko-install now where disk at install time are different from boot | 05:10:34 |
Mic92 | Disko-install let's you re-assign disks: https://github.com/nix-community/disko/blob/master/docs/disko-install.md | 05:12:50 |
Mic92 | Otherwise Disko's image creation Skript will also work. | 05:17:45 |
Mic92 | https://github.com/nix-community/disko/blob/master/docs/reference.md#generating-the-raw-vm-image | 05:18:13 |
| 14 Mar 2024 |
| @federicodschonborn:matrix.org left the room. | 02:04:52 |
| NixOS Moderation Botchanged room power levels. | 18:44:18 |
| 16 Mar 2024 |
| @grahamc:nixos.org joined the room. | 00:00:50 |
| 17 Mar 2024 |
| Felipe Marcelino joined the room. | 17:59:21 |
| 18 Mar 2024 |
| darkwater4213 joined the room. | 00:42:18 |
| comm0n changed their display name from common0r to common. | 00:43:19 |
| comm0n changed their profile picture. | 00:43:23 |
| 19 Mar 2024 |
| NixOS Moderation Botchanged room power levels. | 00:29:45 |
| tcurdt joined the room. | 15:39:40 |
| spewdins joined the room. | 15:40:07 |
| mannp ⚡️ joined the room. | 19:13:12 |
tcurdt | 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 | The disko module configures the mount points (and lvm, luks, etc) in the nixosConfiguration. Otherwise you'll have to do it twice I'd think | 22:09:14 |
bumperboat | * The disko module configures the mount points (and lvm, luks, etc) in the nixosConfiguration. Otherwise you'll have to configure it twice I'd think | 22:10:08 |
| bumperboat set a profile picture. | 22:21:01 |