| 7 Dec 2022 |
@hexa:lossy.network | In reply to @elvishjerricco:matrix.org mlyx: You would make a new initrd systemd service that has wantedBy = ["initrd.target"];. You also want the service to be ordered after file systems are mounted, but if you don't have DefaultDependencies=no, then it'll have After=local-fs.target by default anyway. But eventually we're going to change it so systemd-initrd uses initrd-fs.target like we're supposed to, which services don't get ordered after by default so I tried building a unit like tihs | 18:41:50 |
@hexa:lossy.network | and now the units failed and I wonder how to view the logs | 18:42:25 |
@hexa:lossy.network | boot.initrd.systemd.services = {
impermanence-root = {
wantedBy = [ "initrd.target" ];
after = [ "local-fs.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r zroot/local/root@blank";
};
};
};
| 18:49:44 |
@elvishjerricco:matrix.org | hexa: If you set boot.initrd.systemd.emergencyAccess, you can get a login shell. You can either set it to the hashed password or true for no password | 19:08:24 |
@elvishjerricco:matrix.org | From there you can use systemctl and journalctl | 19:08:39 |
@hexa:lossy.network | ok, cool | 19:11:07 |
@elvishjerricco:matrix.org | Not sure what's going wrong with that though. First guess is that it needs before = ["initrd-nixos-activation.service"];? I imagine rolling back while activation is running would be a no-no | 19:11:28 |
@hexa:lossy.network | added that before configuration | 20:12:05 |
@hexa:lossy.network | now it fails during switching | 20:12:11 |
@hexa:lossy.network | * now it fails during switching ("Switch Root") | 20:12:21 |
@hexa:lossy.network | the /sysroot directory is empty | 20:13:15 |
@hexa:lossy.network | and mount claims things are mounted to /sysroot, /sysroot/state, /sysroot/home | 20:13:42 |
@hexa:lossy.network | so I wonder whether the mounting order is off 😕 | 20:13:51 |
@elvishjerricco:matrix.org | hexa: sometimes I've had trouble with file systems being unmounted before hitting switch-root for a variety of reasons. That's one of the reasons we need to switch to initrd-fs.target instead of local-fs.target | 20:57:24 |
@elvishjerricco:matrix.org | Do you see it saying it's unmounting stuff? | 20:57:32 |
@hexa:lossy.network | no unmounting | 20:57:49 |
@hexa:lossy.network |  Download PXL_20221207_204931189.jpg | 20:58:15 |
@elvishjerricco:matrix.org | It's very unlikely for the mount order to be off. Systemd handles that hierarchaly | 20:58:25 |
@hexa:lossy.network | yeah, I expected that | 20:58:35 |
@hexa:lossy.network | current working theory is that it needs to be after zfs-import.target and before initrd-root-fs.target | 20:58:45 |
@elvishjerricco:matrix.org | I doubt that | 20:59:42 |
@elvishjerricco:matrix.org | For one thing, we're not using initrd-root-fs.target like we're supposed to be for the same kinds of reasons we're not using initrd-fs.target like we're supposed to | 21:00:45 |
@elvishjerricco:matrix.org | But also ZFS allows you to rollback a mounted dataset no problem | 21:01:00 |
@hexa:lossy.network | but what does that mean for mountpoints that go missing? | 21:01:16 |
@elvishjerricco:matrix.org | It makes no sense to me that mountpoints are going missing :P | 21:01:52 |
@elvishjerricco:matrix.org | hexa: In the emergency shell, does systemctl say the mount units are still active? | 21:04:16 |
@hexa:lossy.network | yes | 21:05:01 |
@elvishjerricco:matrix.org | Anything interesting in journalctl -u initrd-nixos-activation.service? | 21:05:55 |
@hexa:lossy.network |  Download 20221207_220555_7472682676845992109.jpg | 21:06:14 |
@hexa:lossy.network | ... does not look like a NixOS installation - not activating | 21:07:17 |