Now the important issue arises as there is already an autofs package to handle mounts and Autodir is in similar line with the autofs package.
The main purpose of autofs is to deal with network mounts on demand instead of mounting all at the same time, which results in preserving system resources. Though there is some support in the autofs package to mount home directories on demand, the requirement is that these home directories must exist already.
On the other side, Autodir specializes only in local directory creation and mounting them on demand.
Autodir can also create real directories in disk file systems such that they do not reside in one single flat base directory. This is how utilities like useradd create by default. In a standard file system setup, all home directories reside in base /home directory. For file systems like ext2, ext3 performance will degrade if large number of home directories exist in single base directory.
For applications accessing these directories, Autodir presents all directories for them in a single autofs mounted virtual base directory on demand; actual directories are created in subdirectories of some other directory in hierarchical style.
For example, the real home for a user with uid user1 will be created as /autohome/u/us/user1 if configured that way, but mounted in /home on demand for applications accessing home directory in /home/user1.
Permissions for real base directory, where actual home directories are kept /autohome in the above example, are kept in such a way that /autohome can not be accessed by anyone except by root.
This mounting of directories on demand and unmounting when not in use presents an interesting opportunity -- the ability to tell when a directory is in use and when it is not in use. This simply means a program like backup can be started when a directory is unmounted.
Autodir exploits this capability by starting the command-line mentioned backup whenever a directory becomes unused.
There is one more important issue to be presented if you are an administrator reading this document. Autodir does not call external programs mount and umount, as is the case with the autofs package; rather, it uses system calls directly. As a side effect, it is faster and more reliable, but mtab is not updated. I felt this was not necessary as all mounts and unmounts are local directories.
Another minor difference is that Autodir is completely multi-threaded. Autofs is also expected to be multi-threaded in future versions.