Operating System - HP-UX
1833861 Members
1881 Online
110063 Solutions
New Discussion

Number of directories within a directory

 
SOLVED
Go to solution
John Paine
Frequent Advisor

Number of directories within a directory

Morning All,
Does anyone know the max number of dirs allowed within a dir? I have a directory with 32771 dirs within it!..when I try a mkdir test I get "too many links"..I suspect there is a limit of 32K (32768) but does anyone know if there is a tunable parameter in the kernel to increase this value?
Thanks,
John.
Time flies like an arrow. Fruit flies like a banana.
2 REPLIES 2
John Palmer
Honored Contributor
Solution

Re: Number of directories within a directory

Found this in the knowledge base:-

System Error (mkdir): Too many links. Problem in directory frag DocId: KBRC00007018 Updated: 5/31/01 2:59:00 PM

PROBLEM
problem: system call from the application is mkdir and the exact error
is "SYSTEM ERROR (mkdir): Too many links. Problem in directory fragment"
CONFIGURATION
V2600
11.0

RESOLUTION
To verify, count the number of subdirectories:

$ ls -l |wc -l
32766

This is hitting the LINK_MAX limit.

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.

Hope this helps,
John
John Paine
Frequent Advisor

Re: Number of directories within a directory

Many Thanks for the info John.
Time flies like an arrow. Fruit flies like a banana.