-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add howto to repair nixos installations
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Repair installations without wiping data | ||
|
||
By default, nixos-anywhere will reformat all configured disks before running the | ||
installation. However it is also possible to mount the filesystems of an | ||
existing installation and run `nixos-install`. This is useful to recover from a | ||
mis-configured NixOS installation by first booting into a NixOS installer or | ||
recovery system. | ||
|
||
To only mount existing filesystems, add `--disko-mode mount` to | ||
`nixos-anywhere`: | ||
|
||
``` | ||
nix run github:nix-community/nixos-anywhere -- --disko-mode mount --flake <path to configuration>#<configuration name> root@<ip address> | ||
``` | ||
|
||
1. This will first boot into a nixos-installer | ||
2. Mounts disks with disko | ||
3. Runs nixos-install based on the provided flake | ||
4. Reboots the machine. |