1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 >An Introduction to AFS</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
10 TITLE="AFS User Guide"
11 HREF="book1.html"><LINK
13 TITLE="About This Guide"
17 HREF="c569.html"></HEAD
28 SUMMARY="Header navigation table"
37 >AFS User Guide: Version 3.6</TH
74 >Chapter 1. An Introduction to AFS</H1
76 >This chapter introduces basic AFS concepts and terms. It assumes that you are already familiar with standard UNIX commands,
77 file protection, and pathname conventions.</P
87 >AFS makes it easy for people to work together on the same files, no matter where the files are located. AFS users do not
88 have to know which machine is storing a file, and administrators can move files from machine to machine without interrupting
89 user access. Users always identify a file by the same pathname and AFS finds the correct file automatically, just as happens in
90 the local file system on a single machine. While AFS makes file sharing easy, it does not compromise the security of the shared
91 files. It provides a sophisticated protection scheme. </P
98 >Client/Server Computing</A
105 >client/server computing</I
107 > model. In client/server computing, there are two types of
114 > store data and perform services for client machines. <SPAN
121 > perform computations for users and access data and services provided by server machines. Some machines act
122 as both clients and servers. In most cases, you work on a client machine, accessing files stored on a file server machine.
131 >Distributed File Systems</A
138 >distributed file system</I
140 > which joins together the file systems of multiple file server
141 machines, making it as easy to access files stored on a remote file server machine as files stored on the local disk. A
142 distributed file system has two main advantages over a conventional centralized file system:
147 >Increased availability: A copy of a popular file, such as the binary for an application program, can be stored on
148 many file server machines. An outage on a single machine or even multiple machines does not necessarily make the file
149 unavailable. Instead, user requests for the program are routed to accessible machines. With a centralized file system, the
150 loss of the central file storage machine effectively shuts down the entire system.</P
154 >Increased efficiency: In a distributed file system, the work load is distributed over many smaller file server
155 machines that tend to be more fully utilized than the larger (and usually more expensive) file storage machine of a
156 centralized file system.</P
162 >AFS hides its distributed nature, so working with AFS files looks and feels like working with files stored on your local
163 machine, except that you can access many more files. And because AFS relies on the power of users' client machines for
164 computation, increasing the number of AFS users does not slow AFS performance appreciably, making it a very efficient
165 computing environment.</P
173 >AFS Filespace and Local Filespace</A
176 >AFS acts as an extension of your machine's local UNIX file system. Your system administrator creates a directory on the
177 local disk of each AFS client machine to act as a gateway to AFS. By convention, this directory is called <SPAN
183 >, and it functions as the root of the <SPAN
192 >Just like the UNIX file system, AFS uses a hierarchical file structure (a tree). Under the <SPAN
198 > root directory are subdirectories created by your system administrator, including your home
199 directory. Other directories that are at the same level of the local file system as <SPAN
224 >, can either be located on your local disk or be links to AFS directories. Files relevant only to
225 the local machine are usually stored on the local machine. All other files can be stored in AFS, enabling many users to share
226 them and freeing the local machine's disk space for other uses.</P
234 >You can use AFS commands only on files in the AFS filespace or the local directories that are links to the AFS
254 > is the administrative domain in AFS. Each cell's administrators determine how client
255 machines are configured and how much storage space is available to each user. The organization corresponding to a cell can be
256 a company, a university department, or any defined group of users. From a hardware perspective, a cell is a grouping of client
257 machines and server machines defined to belong to the same cell. An AFS <SPAN
264 grouping of one or more related cells. For example, the cells at the ABC Corporation form a single site. </P
266 >By convention, the subdirectories of the <SPAN
272 > directory are cellular filespaces, each
273 of which contains subdirectories and files that belong to a single cell. For example, directories and files relevant to the
274 ABC Corporation cell are stored in the subdirectory <SPAN
282 >While each cell organizes and maintains its own filespace, it can also connect with the filespace of other AFS cells.
283 The result is a huge filespace that enables file sharing within and across cells. </P
285 >The cell to which your client machine belongs is called your <SPAN
291 >. All other cells in the AFS
292 filespace are termed <SPAN
306 >Volumes and Mount Points</A
309 >The storage disks in a computer are divided into sections called <SPAN
315 >. AFS further divides
316 partitions into units called <SPAN
322 >, each of which houses a subtree of related files and directories.
323 The volume provides a convenient container for storing related files and directories. Your system administrators can move
324 volumes from one file server machine to another without your noticing, because AFS automatically tracks a volume's location.
327 >You access the contents of a volume by accessing its <SPAN
333 > in the AFS filespace. A mount
334 point is a special file system element that looks and acts like a regular UNIX directory, but tells AFS the volume's name.
335 When you change to a different directory (by using the <SPAN
341 > command, for example) you sometimes
348 > a mount point and start accessing the contents of a different volume than before. You normally do
349 not notice the crossing, however, because AFS automatically interprets mount points and retrieves the contents of the new
350 directory from the appropriate volume. You do not need to track which volume, partition, or file server machine is housing a
351 directory's contents. If you are interested, though, you can learn a volume's location; for instructions, see <A
352 HREF="c1095.html#HDRWQ40"
353 >Locating Files and Directories</A
356 >If your system administrator has followed the conventional practice, your home directory corresponds to one volume,
357 which keeps its contents together on one partition of a file server machine. User volumes are typically named <SPAN
366 >. For example, the volume for a user named <SPAN
384 > and is mounted at the directory <SPAN
388 >/afs/abc.com/usr/smith</B
393 >Because AFS volumes are stored on different file server machines, when a machine becomes unavailable only the volumes on
394 that machine are inaccessible. Volumes stored on other machines are still accessible. However, if a volume's mount point
395 resides in a volume that is stored on an unavailable machine, the former volume is also inaccessible. For that reason, volumes
396 containing frequently used directories (for example, <SPAN
411 >) are often copied and distributed to many file server
423 >Each volume has a size limit, or <SPAN
429 >, assigned by the system administrator. A volume's quota
430 determines the maximum amount of disk space the volume can consume. If you attempt to exceed a volume's quota, you receive an
431 error message. For instructions on checking volume quota, see <A
432 HREF="c1095.html#HDRWQ39"
433 >Displaying Volume Quota</A
436 >Volumes have completely independent quotas. For example, say that the current working directory is <SPAN
440 >/afs/abc.com/usr/smith</B
442 >, which is the mount point for the <SPAN
449 volume with 1000 free blocks. You try to copy a 500 block file from the current working directory to the <SPAN
453 >/afs/abc.com/usr/pat</B
455 > directory, the mount point for the volume <SPAN
461 >. However, you get an error message saying there is not enough space. You check the volume
468 >, and find that the volume only has 50 free blocks.</P
477 >Using Files in AFS</A
485 >The Cache Manager</A
488 >You can access the AFS filespace only when working on an AFS client machine. The <SPAN
495 that machine is your agent in accessing information stored in the AFS filespace. When you access a file, the Cache Manager on
496 your client machine requests the file from the appropriate file server machine and stores (<SPAN
503 of it on your client machine's local disk. Application programs on your client machine use the local, cached copy of the file.
504 This improves performance because it is much faster to use a local file than to send requests for file data across the network
505 to the file server machine. </P
507 >Because application programs use the cached copy of a file, any changes you make are not necessarily stored permanently
508 to the central version stored on the file server machine until the file closes. At that point, the Cache Manager writes your
509 changes back to the file server machine, where they replace the corresponding parts of the existing file. Some application
510 programs close a file in this way each time you issue their <SPAN
517 immediately reopen the file so that you can continue working). With other programs, issuing the <SPAN
523 > command writes the changes only to the local cached copy. If you use the latter type of text
524 editor, you need to close the file periodically to make sure your changes are stored permanently.</P
526 >If a file server machine becomes inaccessible, you can continue working with the local, cached copy of a file fetched
527 from that machine, but you cannot save your changes permanently until the server machine is again accessible.</P
535 >Updating Copies of Cached Files</A
538 >When the central version of a file changes on the file server machine, the AFS <SPAN
545 running on that machine advises all other Cache Managers with copies of that file that their version is no longer valid. AFS
546 has a special mechanism for performing these notifications efficiently. When the File Server sends the Cache Manager a copy of
547 a modifiable file, it also sends a <SPAN
553 >. A callback functions as a promise from the File Server to
554 contact the Cache Manager if the centrally stored copy of the file is changed while it is being used. If that happens, the
561 > the callback. If you run a program that requests data from the changed file, the Cache
562 Manager notices the broken callback and gets an updated copy of the file from the File Server. Callbacks ensure that you are
563 working with the most recent copy of a file.</P
571 >The callback mechanism does not guarantee that you immediately see the changes someone else makes to a file you are
572 using. Your Cache Manager does not notice the broken callback until your application program asks it for more data from the
583 >Multiple Users Modifying Files</A
586 >Like a standard UNIX file system, AFS preserves only the changes to a file that are saved last, regardless of who made
587 the changes. When collaborating with someone on the same files, you must coordinate your work to avoid overwriting each
588 other's changes. You can use AFS access control lists (ACLs) to limit the ability of other users to access or change your
589 files, and so prevent them from accidentally overwriting your files. See <A
591 >Protecting Your Directories
605 >AFS makes it easy for many users to access the same files, but also uses several mechanisms to ensure that only authorized
606 users access the AFS filespace. The mechanisms include the following:
611 >Passwords and mutual authentication ensure that only authorized users access AFS filespace</P
615 >Access control lists enable users to restrict or permit access to their own directories</P
626 >Passwords and Mutual Authentication</A
629 >AFS uses two related mechanisms to ensure that only authorized users access the filespace: passwords and mutual
630 authentication. Both mechanisms require that a user prove his or her identity.</P
632 >When you first identify yourself to AFS, you must provide the password associated with your username, to prove that you
633 are who you say you are. When you provide the correct password, you become <SPAN
640 Manager receives a <SPAN
646 >. A token is a package of information that is scrambled by an AFS authentication
647 program using your AFS password as a key. Your Cache Manager can unscramble the token because it knows your password and AFS's
648 method of scrambling. </P
650 >The token acts as proof to AFS server programs that you are authenticated as a valid AFS user. It serves as the basis
651 for the second means through which AFS creates security, called <SPAN
655 >mutual authentication</I
658 authentication, both parties communicating across the network prove their identities to one another. AFS requires mutual
659 authentication whenever a server and client (most often, a Cache Manager) communicate with each other.</P
661 >The mutual authentication protocol that AFS uses is designed to make it very difficult for people to authenticate
662 fraudulently. When your Cache Manager contacts a File Server on your behalf, it sends the token you obtained when you
663 authenticated. The token is encrypted with a key that only an AFS File Server can know. If the File Server can decrypt your
664 token, it can communicate with your Cache Manager. In turn, the Cache Manager accepts the File Server as genuine because the
665 File Server can decrypt and use the information in the token. </P
673 >Access Control Lists</A
680 >access control lists</I
688 >) to determine who can access the
689 information in the AFS filespace. Each AFS directory has an ACL to specify what actions different users can perform on that
690 directory and its files. An ACL can contain up to about 20 entries for users, groups, or both; each entry lists a user or
691 group and the permissions it possesses.</P
693 >The owner of a directory and system administrators can always administer an ACL. Users automatically own their home
694 directories and subdirectories. Other non-owner users can define a directory's ACL only if specifically granted that
695 permission on the ACL. For more information on ACLs, see <A
697 >Protecting Your Directories and Files</A
701 >A group is composed of one or more users and client machines. If a user belongs to a group that appears on an ACL, the
702 user gets all of the permissions granted to that group, just as if the user were listed directly on the ACL. Similarly, if a
703 user is logged into a client machine that belongs to a group, the user has all of the permissions granted to that group. For
704 instructions on defining and using groups, see <A
709 >All users who can access your cell's filespace, authenticated or not, are automatically assigned to a group called
716 >. For a discussion of placing the <SPAN
722 > group on ACLs, see <A
723 HREF="c1444.html#HDRWQ51"
724 >Extending Access to Users from Foreign
734 >You can use the UNIX mode bits to control access on specific files within an AFS directory; however, the effect of
735 these mode bits is different under AFS than in the standard UNIX file system. See <A
736 HREF="c113.html#HDRWQ16"
750 >Differences Between UNIX and AFS</A
753 >AFS is designed to be similar to the UNIX file system. For instance, many of the basic UNIX file manipulation commands
766 > for remove, and so on) are the same in AFS as
767 they are as in UNIX. All of your application programs work as they did before. The following sections describe some of the
768 differences between a standard UNIX file system and AFS.</P
778 >AFS enables users to share remote files as easily as local files. To access a file on a remote machine in AFS, you
779 simply specify the file's pathname. In contrast, to access a file in a remote machine's UNIX file system, you must log into
780 the remote machine or create a mount point on the local machine that points to a directory in the remote machine's UNIX file
783 >AFS users can see and share all the files under the <SPAN
789 > root directory, given the
790 appropriate privileges. An AFS user who has the necessary privileges can access a file in any AFS cell, simply by specifying
791 the file's pathname. File sharing in AFS is not restricted by geographical distances or operating system differences.</P
799 >Login and Authentication</A
802 >To become an authenticated AFS user, you need to provide a password to AFS.
807 >On machines that use an AFS-modified login utility, logging in is a one-step process; your initial login
808 automatically authenticates you with AFS.</P
812 >On machines that do not use an AFS-modified login utility, you must perform two steps.
818 >Log in to your local machine.</P
828 > command with the <SPAN
835 argument to authenticate with AFS and get your token.</P
845 >Your system administrator can tell you whether your machine uses an AFS-modified login utility or not. Then see the
846 login instructions in <A
847 HREF="c569.html#HDRWQ21"
848 >Logging in and Authenticating with AFS</A
851 >AFS authentication passwords are stored in special AFS database, rather than in the local password file (<SPAN
857 > or equivalent). If your machine uses an AFS-modified login utility, you can change your
858 password with a single command. If your machine does not use an AFS-modified login utility, you must issue separate commands
859 to change your AFS and local passwords. See <A
860 HREF="c569.html#HDRWQ36"
861 >Changing Your Password</A
871 >File and Directory Protection</A
874 >AFS does not rely on the mode bit protections of a standard UNIX system (though its protection system does interact with
875 these mode bits). Instead, AFS uses an access control list (ACL) to control access to each directory and its contents. The
876 following list summarizes the differences between the two methods:
881 >UNIX mode bits specify three types of access permissions: <SPAN
917 >). An AFS ACL uses seven types of permissions: <SPAN
1001 >). For more information, see <A
1002 HREF="c1444.html#HDRWQ46"
1003 >The AFS ACL Permissions</A
1005 HREF="c1444.html#HDRWQ59"
1006 >How AFS Uses the UNIX Mode
1012 >The three sets of mode bits on each UNIX file or directory enable you to grant permissions to three users or groups
1013 of users: the file or directory's owner, the group that owns the file or directory, and all other users. An ACL can
1014 accommodate up to about 20 entries, each of which extends certain permissions to a user or group. Unlike standard UNIX, a
1015 user can belong to an unlimited number of groups, and groups can be defined by both users and system administrators. See
1023 >UNIX mode bits are set individually on each file and directory. An ACL applies to all of the files in a directory.
1024 While at first glance the AFS method possibly seems less precise, in actuality (given a proper directory structure) there
1025 are no major disadvantages to directory-level protections and they are easier to establish and maintain.</P
1040 >The kinds of failures you experience when a standard UNIX file system goes down are different than when one or more
1041 individual AFS file server machines become unavailable. When a standard UNIX file system is inaccessible, the system simply
1042 locks up and you can lose changes to any files with which you were working.</P
1044 >When an AFS file server machine becomes inaccessible, you cannot access the files on that machine. If a copy of the file
1045 is available from another file server machine, however, you do not necessarily even notice the server outage. This is because
1046 AFS gives your cell's system administrators the ability to store copies of popular programs on multiple file servers. The
1047 Cache Manager chooses between the copies automatically; when one copy becomes unavailable, the Cache Manager simply chooses
1050 >If there are no other copies of a file that is stored on an inaccessible server machine, you can usually continue to use
1051 the copy stored in your client machine's local AFS cache. However, you cannot save changes to files stored on an inaccessible
1052 file server machine until it is accessible again.</P
1071 to run programs on a remote machine without establishing a connection to it by using a program such as <SPAN
1077 >. Many of the remote commands (such as <SPAN
1095 >) remain available in AFS, depending on how your
1096 administrators have configured them. If the remote machine has a Cache Manager, your token is used there also and you are
1097 authenticated while the remote command runs. If the remote machine does not run a Cache Manager, you receive the following
1100 CLASS="programlisting"
1101 > Warning: unable to authenticate.
1104 >In this case, you are logged into the remote machine's UNIX file system, but you are not authenticated to AFS. You can
1105 access the local files on the remote machine and the AFS directories that grant access to the <SPAN
1111 > group, but you cannot access protected AFS directories.</P
1119 >Differences in the Semantics of Standard UNIX Commands</A
1122 >This section summarizes differences in the functionality of some commonly issued UNIX commands.
1125 CLASS="variablelist"
1137 >Only members of the <SPAN
1141 >system:administrators</B
1143 > group can use this command to turn on
1144 the setuid, setgid or sticky mode bits on AFS files. (For more information about this group, see <A
1145 HREF="c1444.html#HDRWQ50"
1146 >Using the System Groups on ACLs</A
1159 >Only members of the <SPAN
1163 >system:administrators</B
1165 > group can issue this command on AFS
1178 >Only members of the <SPAN
1182 >system:administrators</B
1184 > group can issue this command on AFS
1185 files and directories.</P
1197 >If the user's AFS tokens are identified by a process authentication group (PAG), the output of this command
1198 includes two large numbers. For a description of PAGs, see <A
1199 HREF="c569.html#HDRWQ24"
1200 >Authenticating with
1214 >The AFS version of this daemon authenticates remote issuers of the AFS-modified <SPAN
1226 > commands with AFS.</P
1233 >login utilities </B
1238 >AFS-modified login utilities both log you into the local UNIX file system and authenticate you with AFS.</P
1250 >You cannot use this command to create a hard link between files that reside in different AFS directories. You must
1257 > option to create a symbolic link instead.</P
1271 >Using AFS with NFS</A
1274 >Some cells use the Networking File System (NFS) in addition to AFS. If you work on an NFS client machine, your system
1275 administrator can configure it to access the AFS filespace through a program called the <SPAN
1286 >Appendix A, Using the NFS/AFS
1296 SUMMARY="Footer navigation table"
1335 >About This Guide</TD