Python error OSError: [Errno 31] Too many links

python, ubuntu

Solution

The 32000 directory entry limit is a filesystem-level ext3 limit.

Problem

See error message below, I get this while trying to create a new directory with Python's native os library. ``` ... File "files.py", line 93, in create_dir os.makedirs(d) File "/usr/lib/python2.7/os.py", line 150, in makedirs makedirs(head, mode) File "/usr/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 31] Too many links: '/var/lib/kaas/77520' ``` I can see that there are just above 32000 directories already in this directory ``` $ ll | wc -l 32001 ``` Is there a limit on the OS level for how many directories that can be created or what is causing the issue here? Or is this a Python limitation? I'm running Ubuntu 12.04.4 LTS.

Original source