From f00bc4c94ca4122d432ae516f8d1d7b405d5d05e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 12 Sep 2006 09:29:28 +0000 Subject: [PATCH] * "Too many links" error. --- doc/manual/troubleshooting.xml | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/doc/manual/troubleshooting.xml b/doc/manual/troubleshooting.xml index 3787ddcd93..fb6e1bd63c 100644 --- a/doc/manual/troubleshooting.xml +++ b/doc/manual/troubleshooting.xml @@ -72,4 +72,44 @@ other. +<quote>Too many links</quote> error in the Nix +store + + +Symptom: when building something, you get an error message such as + + +... +mkdir: cannot create directory `/nix/store/name': Too many links + + + +This is usually because you have more than 32,000 subdirectories +in /nix/store, as can be seen using ls +-l: + + +$ ls -l /nix/store +drwxrwxrwt 32000 nix nix 4620288 Sep 8 15:08 store + +The ext2 file system is limited to a inode link +count of 32,000 (each subdirectory increasing the count by one). +Furthermore, the st_nlink field of the +stat system call is a 16-bit value. + +This only happens on very large Nix installations (such as build +machines). + +Quick solution: run the garbage collector. + +Real solution: put the Nix store on a file system that supports +more than 32,000 subdirectories per directory, such as ReiserFS. +(This doesn’t solve the st_nlink limit, but +ReiserFS lies to the kernel by reporting a link count of 1 if it +exceeds the limit.) + + + + +