Saturday, June 25, 2011

directory limit in ext3 filesystem

Today in the morning one of the LAMP developer brought one issue to my notice that one of the script which create new sub-directory inside a directory and uploads the files to the newly created sub-directory is failing. The new files are not getting uploaded through the script.
 I logged in to the server and tried to create one sub-directory but it did not happen. First i checked the space (df -h) on the server and that file system specifically and found there is ample space on the server. Then i run the following command to get the sub-directories count
# ls -altr | wc -l
and found that it is  31998.
The server is Fedora 8 and the file system is ext3. Now the ext3 file system has this limitation that it can has 32000 links per inode. It means that a directory can have 31,998 sub-directories inside it.

To resolve the issue temporarily i removed some older sub-directories before taking their backups and later for permanent solution we put an archiving script at place.

1 comment:

  1. forgot to add the error that i was getting when i tried mkdir:
    cannot create the dir 'v', too many links..

    ReplyDelete