In very short, I have a NixOS install with an /etc/fstab using UUIDs. However, my bulk drive died. I have backups, the data is not the problem.

But I can’t boot NixOS without the drive. It throws me into an emergency shell, in which I can’t edit /etc/fstab (read-only FS) and since I’m in emergeny mode, nixos rebuild doesn’t work either (seems to be mostly a network issue).

So, what’s the best, non-reinstalling way to fix that?

  • leisesprecher@feddit.orgOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 month ago

    I didn’t know NixOS has its own chroot.

    I’m “chrooted” into the system, howver, user-mapping seems not to work currently. Logrotate fails to build because of a missing user ID.

    EDIT: I commented out all the “advanced” features and had to add some flags.

    services.logrotate.checkConfig = false; in the config solved the “user or group not found” issue and add NIXOS_SWITCH_USE_DIRTY_ENV=1to nixos-rebuild (https://nixos.wiki/wiki/Change_root).

    Now it seems to work and I could piece by piece reactive all the deactivated parts.