[Nix-dev] Disaster recovery / re-deployment

Rickard Nilsson rickard.nilsson at telia.com
Tue Oct 4 09:53:45 CEST 2011


Hi Marc,

Den 2011-09-02 16:23:20 skrev Marc Weber <marco-oweber at gmx.de>:

> Hi Rickard Nilsson,
>
> I'v git repos which provide a minimal bootstrap archive containing
> enough to run nixos-rebuild only.
>
> Of course you must have nixos and nixpkgs an configuration.nix in place.
>
> It tries to modularize nixos-install from cd: you have a run-in-chroot
> command, you have one checking out sources and a minimal store.
>
> Ironically I would have needed such very urgently.
>
> Contact me on irc and I'll give you access to code and a system which
> can build those minimal archives for you (i686 only right now).
>
> I'm interested in helping getting this done.

I took a similar route as you did, I think. I hacked nixos-install a bit,
removing the copying of the store, the chroot setup and nix-pull. Then I
manually prepared the new root: mounted /dev, /proc, /sys, copied in
/nix/store and also mounted the store on $NIX_OTHER_STORES. Then I ran
the modified nixos-install chrooted to the new root. This worked fine,
and I got an identical system up and running.

However, all that juggling with chroot, NIX_OTHER_STORES and /nix/store
doesn't appeal to me :)

I'm starting to think that maybe I should just keep a dump of the Nix
database, and the symlinks in /boot, around. Then it
should be possible to boot up the system if I just put /nix/store,
/boot and /etc/nixos in place, shouldn't it? When the system is booted
I could just restore the Nix database dump, and then the old store would
be perfectly valid and usable, wouldn't it? Or do I also have to backup
and restore the gcroots? If so, is there some other way to convince NixOS
to just use the store in place, and not start to delete things?


Best regards,
   Rickard


More information about the nix-dev mailing list