Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have run into the 32k subdirectory limit. Some research makes it sound like the dir_nlink filesystem option will remove this limit, but I can't find any documentation on it. Is it available for ext3? If I must upgrade to ext4, how do I do that? Can I run ext4 on top of my ext3 fs and get the benefit of this change? Do I need to get a more recent kernel? I am running Ubuntu 9.04 stable server the kernel is 2.6.18.8-linode19. Thanks.

share|improve this question
add comment

migrated from stackoverflow.com Oct 15 '09 at 19:02

This question came from our site for professional and enthusiast programmers.

4 Answers

Time to install a database?

share|improve this answer
1  
no because that would mean rewriting 10000 lines of crufty perl code :) this app ran for years on a system without the 32k limit and now i'm running it on a generic OS. changing the filesystem is the right solution. –  spot Oct 15 '09 at 21:18
add comment

Ext4 does state that they have no subdirectory limit. They also say that it's safe to use for production as of Linux 2.6.28. They also detail how to migrate an ext3 filesystem to ext4. The subdirectory limit should be lifted for existing files since it's only for extents that pre-upgrade files will not be upgraded.

share|improve this answer
add comment

The normal technique is to create several levels of subdirectories if you need to store very large numbers of files - but don't overdo it, having too many directories is inefficient too.

If you need to store > 32M files, just break them down by the last two digits of the ID or something, then you'll get 100 dirs with the files approximately evenly distributed.

share|improve this answer
add comment

If you need a right now solution, you can replace subdirectories with symlinks. Symlinks are not limited to 32k. This allows you to create a deeper directory structure as others recommend but still allow programs to access it in one flat space.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.