old-www/HOWTO/Autodir-HOWTO/x130.html

227 lines
4.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Differences between Autodir and Autofs</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="What Autodir is not"
HREF="x126.html"><LINK
REL="NEXT"
TITLE="How it works"
HREF="x170.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="x126.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x170.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN130"
></A
>6. Differences between Autodir and Autofs</H1
><P
>Issue arises when you are already using the <SPAN
CLASS="application"
>Autofs</SPAN
> package, handling the mounts of (home) directories. Let's look at the differences between the two packages:</P
><P
></P
><UL
><LI
><P
>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 <EM
>these home directories must exist already</EM
>.</P
><P
>On the other hand, <EM
>Autodir</EM
> specializes <EM
>only</EM
> in local directory creation and mounting them on demand.</P
><P
><EM
>Autodir</EM
> can also create real directories in disk file systems, which do not reside in one single flat base directory. This is how utilities like <B
CLASS="command"
>useradd</B
> create by default. In a standard file system setup, all home directories reside in the base <TT
CLASS="filename"
>/home</TT
> directory. For file systems like ext2 and ext3 performance will degrade if a large number of home directories exist in one single base directory.</P
><P
> For applications accessing these directories, <EM
>Autodir</EM
> presents all directories for them in a <EM
>single</EM
> autofs mounted virtual base directory <EM
>on demand</EM
>; actual directories are created in subdirectories of some other directory in hierarchical style.</P
><P
> For example, the real home for a user with username <TT
CLASS="literal"
>user1</TT
> will be created as <TT
CLASS="filename"
>/autohome/u/us/user1</TT
> if configured that way, but mounted in <TT
CLASS="filename"
>/home</TT
> on demand for applications accessing the home directory in <TT
CLASS="filename"
>/home/user1</TT
>.</P
><P
>Permissions for the real base directory, where the actual home directories are kept (<TT
CLASS="filename"
>/autohome</TT
> in the above example), are kept in such a way that <TT
CLASS="filename"
>/autohome</TT
> can not be accessed by anyone except by root.</P
><P
>This mounting of directories on demand and unmounting when not in use presents an interesting opportunity: the ability to tell whether a directory is in use or not. If a directory is not in use, a program like a backup application can be safely started when a directory is unmounted.</P
><P
><EM
>Autodir</EM
> exploits this capability by starting the command-line mentioned backup whenever a directory becomes unused.</P
></LI
><LI
><P
>There is one more important issue to be presented if you are an administrator reading this document. <EM
>Autodir</EM
> does not call the external programs <B
CLASS="command"
>mount</B
> and <B
CLASS="command"
>umount</B
>, 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 the <TT
CLASS="filename"
>mtab</TT
> file is not updated. I felt this was not necessary as all mounts and unmounts are local directories.</P
></LI
><LI
><P
>Another minor difference is that <EM
>Autodir</EM
> is completely <EM
>multi-threaded</EM
>. Autofs is also expected to be multi-threaded in future versions.</P
></LI
></UL
></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="x126.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="x170.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>What Autodir is not</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>How it works</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>