<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML ><HEAD ><TITLE >Directory organization in the real base directory</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Autodir HOWTO" HREF="index.html"><LINK REL="PREVIOUS" TITLE="Some definitions" HREF="x235.html"><LINK REL="NEXT" TITLE="Virtual directory expiration" HREF="vdexp.html"></HEAD ><BODY CLASS="sect1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Autodir HOWTO</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="x235.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="vdexp.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="dirorg" ></A >9. Directory organization in the real base directory</H1 ><P >Why should there be any special organization in the <EM >real base directory</EM >? If we just create all <EM >real directories</EM > in one <EM >real base directory</EM > there could be a performance penalty when there are a large number of <EM >real directories</EM > to be created. File systems like ext2/ext3 are not optimized for this kind of flat directory structure.</P ><P >It would be much better if the <EM >real base directory</EM > 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.</P ><P >There are three types of directory organization:</P ><P ></P ><DIV CLASS="variablelist" ><DL ><DT ><EM >level 0</EM ></DT ><DD ><P >Actually no organization. All home directories are created directly under <EM >real base directory</EM >.</P ></DD ><DT ><EM >level 1</EM ></DT ><DD ><P >The <EM >Real base directory</EM > 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 <TT CLASS="filename" >user1</TT > directory is to be created, first a directory named 'u' is created under <EM >real base directory</EM >. Then in that subdirectory the actual directory <TT CLASS="filename" >user1</TT > is created as <TT CLASS="filename" >/<real_base_directory>/u/user1</TT >.</P ></DD ><DT ><EM >level 2</EM ></DT ><DD ><P >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 <TT CLASS="literal" >user1</TT >, as in the above example, the <TT CLASS="filename" >/<real_base_directory>/u/us/user1</TT > directory is created.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="x235.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="vdexp.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Some definitions</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Virtual directory expiration</TD ></TR ></TABLE ></DIV ></BODY ></HTML >