Open remexre opened 1 year ago
nix-store --repair-path
bails out when it gets theseEIO
s, and it's not clear whether it's possible to repair the files on a live NixOS system, since/nix/store
appears read-only to... users' systemd slices? Tosudo
under a graphical shell, anyway.
The nix store can repair the path by fetching it from a substituter or if it knows how to build, build it. I think it just needs to handle EIO correct.
Describe the bug
ZFS can detect hardware-failure-related corruption of disk blocks. In situations where it cannot automatically recover the contents of the file,
read()
s from the file will returnEIO
.nix-store --repair-path
bails out when it gets theseEIO
s, and it's not clear whether it's possible to repair the files on a live NixOS system, since/nix/store
appears read-only to... users' systemd slices? Tosudo
under a graphical shell, anyway.Steps To Reproduce
sudo zpool scrub whatever
, then runsudo zpool status -v
, notice anerrors: Permanent errors have been detected in the following files:
section.sudo nix-store --repair-path
on one of the paths that appears.error: reading from file: Input/output error
(I expect a "synthetic" repro could use ptrace to inject EIOs?)
Expected behavior
The store path should be replaced with one that's freshly downloaded, without an error.
For massive bonus points, NixOS gets an option that hooks into
services.zfs.autoScrub
and--repair-path
s any corrupted files in the Nix store once the scrub completes.nix-env --version
outputnix-env (Nix) 2.11.0