1751972 Members
5270 Online
108784 Solutions
New Discussion юеВ

Hard links limitation

 
SOLVED
Go to solution
Nick_13
New Member

Hard links limitation

Hi all,

I found for myself, that there is a default limitation for number of sub-directories and this limitation is 32767 (LINK_MAX param).
Is anyone know how to change this parameter (if possible)?

Regards,
Nick
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: Hard links limitation

Hi Nick:

Yes, you can increase this value. From Technical Knowledge Base document #KBRC00007018:

/begin_quote/

...install PHKL_21210 (requires reboot) and the dependency PHKL_18543

PHKL_21210 information:

The number of subdirectories which can be created for VxFS is limitted to LINK_MAX

The patch introduced a new tunable for the Vertias filesystem (vx_maxlink) which can be used to override the MAXLINK value which governs the ceiling of subdirectory creation.

A new VxFS tunable (vx_maxlink) has been added which allows this limit to be changed to any value between LINK_MAX and INT_MAX (See limits(5)).

INT_MAX Max decimal value of an 2147483647 +
int
LINK_MAX Max number of links to a 32767 +*
single file

Special Installation Instructions: After patch is installed the vx_maxlink tunable can be set in /stand/system. At that time the system needs to be rebuilt and rebooted.

Since you are at the LINK_MAX limit you will need to build a new kernel after the patch is installed which specifies the value of vx_maxlink kernel tunable to a value less than 2147483647.

/end_quote/

Regards!

...JRF...
Stefan Farrelly
Honored Contributor

Re: Hard links limitation


Sure, its defined in /usr/include/limits.h so you could modify this header file, but then you would need the source for sh, mkdir etc. commands so you could recompile them with the new limitation. No chance im afraid.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Alex Glennie
Honored Contributor

Re: Hard links limitation

Parent directories have a limit to the amount of sub-directories that can be under them. This limitation is set by the value of LINK_MAX at 32767 in /usr/include/limits.h

An alternative is to use symbolic links as these do not create any new directory entries, and therefore no ".." entries.

However !!!!

An 11.0 patch ( [PHKL_21210/PACHRDME/English] ) addressed this problem.

The patch introduced a new tunable for the Vertias
filesystem (vx_maxlink) which can be used to overridethe MAXLINK value which governs the ceiling of subdirectory creation. .... hope some of the above is of use ?


A. Clay Stephenson
Acclaimed Contributor

Re: Hard links limitation

Hi Nick:

One thing to bear in mind that directory searches are linear. Huge directories are thus very inefficient. If at all possible, use the directory structure as intended - a tree.

Regards, Clay
If it ain't broke, I can fix that.
Nick_13
New Member

Re: Hard links limitation

Thanks guys for the help!
Another question to this topic. Is anyone know how to tune also Solaris 7/8 and Linux (I guess Linux also have some default limit). With Solaris I saw 32K limitation as well as HP-UX with a little bit different error.
I know that I never will use even 32K directories, it's just for the test purpose.

Thanks one more time for your help!
Regards,
Nick