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.
feedback
|
migrated from stackoverflow.com Oct 15 '09 at 19:02
This question came from our site for professional and enthusiast programmers.
Time to install a database? | |||||
feedback
|
|
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. | |||
|
feedback
|
|
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. | |||
|
feedback
|
|
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. | |||
|
feedback
|