Locating Files and Directories

Normally, you do not need to know which file server machine stores the volume containing a file or directory. Given the pathname to a file, the Cache Manager on your client machine automatically accesses the appropriate server machine.

If you become unable to access a file, however, it can be useful to know which file server machine houses it. You can then check whether the File Server process or machine is functioning correctly, as described in Checking the Status of Server Machines. Or, if your system administrators schedule downtime for a machine, you can learn whether the outage is likely to prevent you from accessing certain files.

To Display a File or Directory's Location

Issue the fs whereis command to display the file server machine on which a file or directory is stored.

   % fs whereis [<dir/file path>+]

where dir/file path specifies the pathname of each file or directory for which you want location information. If you do not provide a pathname, the output reports the machine housing the volume that contains the current working directory.

If the output mentions more than one machine, there is a copy of the volume at each site (the volume is replicated). Your system administrators can choose to replicate volumes that contain information many people need to use, both for load balancing reasons and to make the information available even if there is an outage on one machine that houses the volume.

Example: Displaying Directory Location

The following example displays the names of the server machines that house the home volumes for users terry and pat.

   % cd /afs/example.com/usr
   % fs whereis terry pat
   File /afs/example.com/usr/terry is on host fs2.example.com
   File /afs/example.com/usr/pat is on host fs3.example.com