Appendix C. The Demand-Attach File Server

# Appendix C. The Demand-Attach File Server

This chapter explains and describes the Demand-Attach File Server (DAFS for short), a new feature in OpenAFS 1.6. A few things are different when setting up and maintaining a DAFS fileserver vs a traditional fileserver, so it is important to know which one you are running.

If you are trying to decide whether or not to run DAFS on a fileserver, note that you can switch between DAFS and the traditional fileserver fairly easily at any time. Aside from performance differences, the two fileservers generally look and act similarly, so choosing one over the other in the beginning should not hurt you later on. So, if you are not overly concerned with performance, you can just pick one and follow the directions for it, and you should be fine.

## Justification and Background

DAFS changes many things with how the fileserver and other server processes access volumes on disk. Most of these changes are only of concern to developers, as there are no visible differences to users or administrators. A few changes are only of concern to administrators while debugging a problem, and only one or two changes affect the day-to-day administration of a fileserver. See the sections on DAFS Binaries and Salvaging for the main functional differences.

Among other things, DAFS provides a new way for the fileserver and other server programs to access volumes. It does not change how file data is accessed inside a volume (like namei or inode do), but rather how a volume as a whole is accessed by the fileserver. When a traditional fileserver is started, it will locate and attach all AFS volumes it can find on all AFS partitions on the server. This attachment process involves reading the volume header and setting a flag to say that the volume is in use. On a clean shutdown, the fileserver detach all volumes it attached by clearing that flag. If the fileserver encounters a volume where the flag is already set before it attached the volume, it will know that volume was not detached cleanly, and that it needs to be salvaged.

This process of attaching and detaching at startup and shutdown takes time. When fileservers start to have thousands of volumes, it can take several minutes to start or cleanly shutdown. Additionally, when a fileserver is shutdown uncleanly, all of the volumes on the server must be salvaged before the fileserver can be brought up again. Even volumes that nobody has ever accessed must be salvaged.

To improve this situation, DAFS does not attach all volumes on startup. Instead, volumes are only attached when they are first accessed, and are detached if idle for a long period of time (see the -vlru* options for the fileserver; this is configurable but is generally several hours).

Thus, after an unclean shutdown with DAFS, only the volumes in use at the time of the shutdown need to be salvaged. In addition, the fileserver does not need to wait for salvaging to finish before starting up. Instead of salvaging everything before the fileserver starts, the fileserver causes salvages to be issued on a volume when a damanged volume is accessed (called "demand-salvages").

The result of all of this is that a fileserver running DAFS can generally be started and stopped in a manner of seconds, where a traditional fileserver could take dozens of minutes, or even hours in the case of an unclean shutdown.

Appendix B. Appendix B. Configuring Legacy Components |  | DAFS Binaries