Data ONTAP Discussions

MaxDirSize and inodes


I've read a similar discussion ( although some of the aspects are not clear. I hope someone with more insight might be able to help.

Every once in a while our monitoring system alerts us of directories where the MaxDirSize limit is being reached, and we suggest the users the following solution (

  1. Copy the files into a temporary directory.
  2. Delete the original directory.
  3. Rename the temporary directory with the original directory name.

Or creating more directories and disperse the files among them also helps. Although, sometimes the situation is not so simple eg. it is a log or working directory of an application. In these case users only try do delete files as their understanding of the problem is that this is "only" a free space issue, but deletion won't solve the problem.

So my question would be, deleting files won't change number of inodes being used, that's why the original directory needs to be deleted? (Or is my understanding flawed regarding ONTAP).

I know this is too vague, but I found this for linux (

By linux When a file name is deleted from the directory tree, the file name's connection to the inode number is severed.  If the file name is the last "link" to the inode number, thereby reducing the number of inode (file content) "links" to file names to 0, then the inode is detatched from the actual data and returned to the pool of free inode numbers.  The data remains on the disk, but unaccessable by traditional means now that it no longer has a corresponding inode number.  The disk space is free to be overwritten.  This process is called unlinking.

Thanks in advance for helping to untangle this mysterySmiley Happy

Best regards

Attila Gulyas

ps.: ... and a Happy New YearSmiley Happy


Re: MaxDirSize and inodes

Hi Attila,

      Actually deleting the files will suffice.  Once you delete the files, the inodes are released and ready for use again.  At a previous employer we had this issue with a group who decided that Windows says it can handle 4 billion files in one directory, so they had everything dumping into one directory....Aside from how completely ignorant and ridiculous that thought is, it also didn't work.

The MaxDirSize alert is the size of the metadata of all the files that reside under on directory.  A directory is really nothing more than a pointer file, but it has to keep all the metadata about all the files under it.  The size of all that metadata it needs to maintain the structure is the MaxDirSize number.  So fewer files, less metadata, smaller MaxDirSize.  You can simply have them zip files in the directory rather than delete them, you can break your log files down into days or hours to reduce the number of files under any one directory as well.  Basically anything that reduces the number of files, that the directory has to maintain metadata on will reduce it.

- Scott