From 4df0b9903d391b7531e06ca859c46f261335bdc1 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Fri, 2 Jul 2021 10:48:31 +0800 Subject: nixos: nixos/doc/manual/administration/store-corruption.xml to CommonMark --- .../administration/store-corruption.section.md | 28 +++++++++++++++++ .../doc/manual/administration/store-corruption.xml | 36 ---------------------- .../doc/manual/administration/troubleshooting.xml | 2 +- 3 files changed, 29 insertions(+), 37 deletions(-) create mode 100644 nixos/doc/manual/administration/store-corruption.section.md delete mode 100644 nixos/doc/manual/administration/store-corruption.xml (limited to 'nixos/doc/manual/administration') diff --git a/nixos/doc/manual/administration/store-corruption.section.md b/nixos/doc/manual/administration/store-corruption.section.md new file mode 100644 index 0000000000000..bd8a5772b37c6 --- /dev/null +++ b/nixos/doc/manual/administration/store-corruption.section.md @@ -0,0 +1,28 @@ +# Nix Store Corruption {#sec-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 + +```ShellSession +# 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: + +```ShellSession +# 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. diff --git a/nixos/doc/manual/administration/store-corruption.xml b/nixos/doc/manual/administration/store-corruption.xml deleted file mode 100644 index b9d11152d5e13..0000000000000 --- a/nixos/doc/manual/administration/store-corruption.xml +++ /dev/null @@ -1,36 +0,0 @@ -
- 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. - -
diff --git a/nixos/doc/manual/administration/troubleshooting.xml b/nixos/doc/manual/administration/troubleshooting.xml index 16cf4f00b26d2..218324b299ac9 100644 --- a/nixos/doc/manual/administration/troubleshooting.xml +++ b/nixos/doc/manual/administration/troubleshooting.xml @@ -11,6 +11,6 @@ - + -- cgit 1.4.1