this post was submitted on 21 Mar 2025
7 points (88.9% liked)

Nix / NixOS

2129 readers
7 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 3 weeks ago* (last edited 3 weeks 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.