!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

84 Members
systemd in NixOs's stage 1, replacing the current bash tooling https://github.com/NixOS/nixpkgs/projects/5127 Servers

Load older messages


SenderMessageTime
10 Nov 2022
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgdunno if we include that rule in systemd-stage-1 or not18:32:43
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI think we do?18:32:45
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgLooks like we do18:36:11
@me:linj.tech@me:linj.techthanks for the info.18:36:28
@elvishjerricco:matrix.org@elvishjerricco:matrix.org
In reply to @me:linj.tech
no, the old initrd just dies if one disk is missing. Because of that, I try this systemd one
I'd be curious what it looks like when the scripted initrd dies this way
18:39:04
@me:linj.tech@me:linj.techkernel panic18:39:29
@elvishjerricco:matrix.org@elvishjerricco:matrix.org linj: O_O 18:39:39
@me:linj.tech@me:linj.techI can take a screenshot if you want18:39:46
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgthat would be wonderful18:39:52
@me:linj.tech@me:linj.techimage.png
Download image.png
18:41:19
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI see18:41:50
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgIt dies because it doesn't find luks-2 at all18:41:56
@me:linj.tech@me:linj.techthe old initrd is easy to workaround for this case18:41:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgso18:42:19
@elvishjerricco:matrix.org@elvishjerricco:matrix.org once you're in the emergency shell in the systemd stage 1, you can probably manually mount the degraded btrfs root and let it continue with systemctl default 18:42:44
@me:linj.tech@me:linj.techhttps://github.com/NixOS/nixpkgs/blob/717ccacc16e8de01ff06f2f83db6415c01f11527/nixos/modules/system/boot/luksroot.nix#L15518:42:44
@me:linj.tech@me:linj.techjust do not die and skip some functions18:42:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.org linj: Btw what does your fileSystems."/".device look like? 18:45:20
@me:linj.tech@me:linj.techemm, I use root on tmpfs18:45:51
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgoh18:45:58
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgthen whatever your btrfs fileSystem device looks like18:46:10
@me:linj.tech@me:linj.tech
  boot.initrd.luks.devices = {
    # TODO what if one disk is missing
    "nixos-1" = {
      allowDiscards = true;
      bypassWorkqueues = true;
      device = "/dev/disk/by-label/luks-1";
      # fallbackToPassword = true;
      # TODO x-initrd.attach
      # TODO x-systemd.device-timeout=
      crypttabExtraOpts = [ "nofail" "x-systemd.device-timeout=10" ];
    };
    "nixos-2" = {
      allowDiscards = true;
      bypassWorkqueues = true;
      device = "/dev/disk/by-label/luks-2";
      # fallbackToPassword = true;
      crypttabExtraOpts = [ "nofail" "x-systemd.device-timeout=10" ];
    };
  };

  fileSystems."/" =
    { device = "none";
      fsType = "tmpfs";
      options = [ "defaults" "size=500M" "mode=755" ];
    };

  # TODO what if one disk is missing
  fileSystems."/boot" =
    { device = "/dev/disk/by-label/efi-1";
      fsType = "vfat";
      options = [ "nofail" ];
    };

  # TODO what if one disk is missing
  fileSystems."/boot2" =
    { device = "/dev/disk/by-label/efi-2";
      fsType = "vfat";
      options = [ "nofail" ];
    };

  # TODO what if one disk is missing
  fileSystems."/nix" =
    { # device = "/dev/disk/by-label/nixos";
      device = "/dev/disk/by-uuid/f93cfbf1-e9b4-46ca-b7cb-6f3fb1554fbb";
      fsType = "btrfs";
      options = [ "degraded" "noatime" "ssd" "compress=zstd:1" "space_cache=v2" "subvol=@nix" ];
    };

  fileSystems."/var" =
    { # device = "/dev/disk/by-label/nixos";
      device = "/dev/disk/by-uuid/f93cfbf1-e9b4-46ca-b7cb-6f3fb1554fbb";
      fsType = "btrfs";
      options = [ "degraded" "noatime" "ssd" "compress=zstd:1" "space_cache=v2" "subvol=@var" ];
    };

  fileSystems."/home" =
    { # device = "/dev/disk/by-label/nixos";
      device = "/dev/disk/by-uuid/f93cfbf1-e9b4-46ca-b7cb-6f3fb1554fbb";
      fsType = "btrfs";
      options = [ "degraded" "noatime" "ssd" "compress=zstd:1" "space_cache=v2" "subvol=@home" ];
      neededForBoot = true;
    };

  fileSystems."/state" =
    { # device = "/dev/disk/by-label/nixos";
      device = "/dev/disk/by-uuid/f93cfbf1-e9b4-46ca-b7cb-6f3fb1554fbb";
      fsType = "btrfs";
      options = [ "degraded" "noatime" "ssd" "compress=zstd:1" "space_cache=v2" "subvol=@state" ];
      neededForBoot = true;
    };
18:46:31
@elvishjerricco:matrix.org@elvishjerricco:matrix.org gotcha, so it's normal to just pick one of the devices in a btrfs raid array as the device? 18:47:11
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgthat's what the udev rule suggested as well and I just wanted to know18:47:32
@me:linj.tech@me:linj.tech
In reply to @elvishjerricco:matrix.org
gotcha, so it's normal to just pick one of the devices in a btrfs raid array as the device?
need to do btrfs device scan first I think
18:48:39
@elvishjerricco:matrix.org@elvishjerricco:matrix.org I believe the udev rule + systemd do it a little differently, but yea 18:49:19
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgthe scripted initrd would have to18:49:28
@me:linj.tech@me:linj.tech
In reply to @elvishjerricco:matrix.org
once you're in the emergency shell in the systemd stage 1, you can probably manually mount the degraded btrfs root and let it continue with systemctl default
yeah, it works
18:55:16
@me:linj.tech@me:linj.tech Should we set x-initrd.attach by default? its doc is man crypttab 20:59:41
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThat is a complicated topic21:48:04

Show newer messages


Back to Room ListRoom Version: 6