Maximum Number of Files in a Single Directory for Netapp NFS mounts on Linux

There are two limits that you may have hit.

  • inodes (unlikely)

    You've consumed all of the available inodes for that volume. You can confirm this with the commands df -i and maxfiles.

  • maxdirsize (more likely)

    ONTAP imposes a limit on size of directories. Size being a product of metadata/hardlinks, not file content. This limit defaults (assuming >6.5) to 1% of your system RAM. It does so to ensure that large directories don't impact system performance. Because linear directory scans require directory data structures to be loaded into memory. Quick overview:

    • You can check a directory size with ls -lkd.
    • Raising maxdirsize for a volume is a bit of a one way operation.
    • Only raise it in small increments.
    • You can't reduce a directory's size by deleting it's contents.
    • I have these two bookmarked links which contain a lot more information.
      • NOW: What is maxdirsize?
      • Communities: maxdirsize Recommended Setting and Performance Implications

If it's neither of these issues then I'd recommend checking and posting your ONTAP logs.


The system is hitting the link limit for a directory that is a fixed limitation of the NetApp ONTAP filesystem. From this knowledge base article:

Starting with Data ONTAP 6.5, the maximum number of subdirectories a single directory may have is 99998 (100K). Data ONTAP 6.4 and earlier versions were restricted to 65534 (64K) subdirectories. This number may not be changed. To understand the reason for this limit, see the section below on hard links and subdirectory implementation.