Linuxdoc Linux Questions
Click here to ask our community of linux experts!
Custom Search

9. Directory organization in the real base directory

Why should there be any special organization in the real base directory? If we just create all real directories in one real base directory there could be a performance penalty when there are a large number of real directories to be created. File systems like ext2/ext3 are not optimized for this kind of flat directory structure.

It would be much better if the real base directory is divided into more subdirectories, or even to divide these subdirectories again into more subdirectories. And in the final subdirectories actual home directories are kept.

There are three types of directory organization:

level 0

Actually no organization. All home directories are created directly under real base directory.

level 1

The Real base directory is divided into more subdirectories. The subdirectory names are derived from the first character of the final directory to be created. For example, if the user1 directory is to be created, first a directory named 'u' is created under real base directory. Then in that subdirectory the actual directory user1 is created as /<real_base_directory>/u/user1.

level 2

Same as level 1 organization but after the first level of subdirectories, a second level of subdirectories is created. The names here are the first two characters of the final directory to be created. For example, for user user1, as in the above example, the /<real_base_directory>/u/us/user1 directory is created.