[Nottingham] Max number of hard links?

Martin martin at ml1.co.uk
Tue Aug 8 19:22:32 BST 2006


Just to stir up a sleepy list... ;-)


How many hard links to the same file can made before the filesystem or
kernel complain or die?

Is this filesystem specific? What number for ReiserFS?

(I'm sure there must be a limit depending on what reference count is
used inside the target inode, or is it more clever than that?)


Pause, thought, ... Googling and:

Specifications for ReiserFS:  (in according to NIST standard)

Version:
  	3.5				3.6

max number of files:
 	2^32 - 3 => 4 Gi - 3 		2^32 - 3 => 4 Gi - 3

max number files a dir can have:
 	518701895			2^32 - 4 => 4 Gi - 4
but in practice this value is limited by hash function. r5 hash allows
about 1 200 000 file names without collisions 	

max file size:
 	2^31 - 1 => 2 Gi - 1 		2^60 - bytes => 1 Ei,
but page cache limits this to 8 Ti on architectures with 32 bit int

max number links to a file:
 	2^16 => 64 Ki 			2^32 => 4 Gi

max filesystem size:
 	2^32 (4K) blocks => 16 Ti 	2^32 (4K) blocks => 16 Ti


So for ReiserFS 3.6 the answer is a stupendous 4 G! No worries there
then! Also pretty good for the 1 million+ files in a directory before
things start to slow down due to hash collisions.

OK, so interesting for me at least :-)

Cheers,
Martin

-- 
----------------
Martin Lomas
martin at ml1.co.uk
----------------



More information about the Nottingham mailing list