diff --git a/doc/manual/troubleshooting.xml b/doc/manual/troubleshooting.xml
index b78c35a35e1..fd43ff6b561 100644
--- a/doc/manual/troubleshooting.xml
+++ b/doc/manual/troubleshooting.xml
@@ -4,6 +4,8 @@
Troubleshooting
+
+
Boot problems
If NixOS fails to boot, there are a number of kernel command
@@ -65,9 +67,9 @@ unless something is very wrong.)
-
+
-Maintenance mode
+Maintenance mode
You can enter rescue mode by running:
@@ -81,9 +83,9 @@ just exit from the rescue shell.
-
+
-Rolling back configuration changes
+Rolling back configuration changes
After running nixos-rebuild to switch to a
new configuration, you may find that the new configuration doesn’t
@@ -127,4 +129,39 @@ lrwxrwxrwx 1 root root 78 Aug 12 13:54 /nix/var/nix/profiles/system-268-link ->
+
+
+Nix store corruption
+
+After a system crash, it’s possible for files in the Nix store
+to become corrupted. (For instance, the Ext4 file system has the
+tendency to replace un-synced files with zero bytes.) NixOS tries
+hard to prevent this from happening: it performs a
+sync before switching to a new configuration, and
+Nix’s database is fully transactional. If corruption still occurs,
+you may be able to fix it automatically.
+
+If the corruption is in a path in the closure of the NixOS
+system configuration, you can fix it by doing
+
+
+$ nixos-rebuild switch --repair
+
+
+This will cause Nix to check every path in the closure, and if its
+cryptographic hash differs from the hash recorded in Nix’s database,
+the path is rebuilt or redownloaded.
+
+You can also scan the entire Nix store for corrupt paths:
+
+
+$ nix-store --verify --check-contents --repair
+
+
+Any corrupt paths will be redownloaded if they’re available in a
+binary cache; otherwise, they cannot be repaired.
+
+
+
+