I have a file that I keep linking to. It's up to 45 links now. Does anyone know how I can find out what the maximum number of hard links is in OS X 10.11 (El Capitan)?
migrated from serverfault.com Jan 17 at 1:06
This question came from our site for system and network administrators.
It seems the theoretical limit is about 1 billion hard links on an HFS+ volume.
The limit for links to a single file is 4294967295, the maximum number of a UInt32, which is about four times larger than the volume limit, which you'll exhaust first.
As a practical matter, this design is quite strange, and suffers from performance issues. The more hard links you have on a volume, the slower it will be to create a new one, as the system must first find an unused link reference number, then insert it into the metadata directory. Then that metadata directory must be searched to dereference a hard link.
You may begin seeing performance problems with only a few thousand links; your great-grandchildren won't live long enough to create a billion if you start today. In practice you'll notice this most often when managing Time Machine backups, which use hard links extensively.