Error when collecting garbage

I am getting the following error when I collect garbage:

error: getting status of '/nix/store/.links/0zbb0y7sz3mwxjb2ipixpp3pj05an6hgrxmn1fjnw2crclda6cmw': Structure needs cleaning

How do I fix this?

Thanks

Googling around, I had found other issues like yours, that builds fail. My situation is a little different: my os and home manger rebuilds went fine. I get this error on garbage collection.

1 Like

The remedy and cause are likely the same as above: FS corruption.
Run sudo nix-store --check-contents --repair --verify and see if that helps.

This gives me the same error as above. I should specify, maybe, that the error happens after all of the processing, so the first time I ran the command a lot of garbage did get deleted.

In that case I don’t know any surgical option, I’d just wipe /nix/store and “reinstall” from a live ISO (this should not affect state or data.)

I’m going to deal with this today. Just to clarify: by “reinstall” /nix/store you mean run the installer into the same partition without reformatting, correct? Or should I also wipe the partition? (My /home is not on a separate partition, but fully backed up.)

No reformats and no deleting anything but /nix. Make sure you mount your EFI system partition.

1 Like