> We (ir.stanford.edu) are thinking about changing the way we layout
> home directories in AFS and would like to get some feedback on what...

> [using] /afs/ir/users/[a-z]/$USER                  /afs/ir/users/u/username

> [considering] /afs/ir/users/[a-z]/[a-z]/$USER      /afs/ir/users/u/s/username
>    [or maybe] /afs/ir/users/NNNN/$USER             NNNN random distributed

> Other options I've thought of include hashing on the uid, doing some sort
> of modulo arithmetic on the uid, or treating the uid as a hex number and
> using them to create the subdirectories. The problem with this method is
> if your UID changes then so does your directory name (unless you have some
> huge directory full of symlinks which defeats the whole purpose if you use
> this directory in a password file). These approaches also make it harder
> to find someone's home directory (although ~user works fine if you have
> the full password file on your system).

> We could eventually have about 20,000 directories in AFS/DFS if we migrate
> all our users into AFS.

We are fairly close to 20,000 users in AFS home-directories.
We've gone to:

     /afs/isu/users/NN/MM/username

where MM are the 5 LS bits of username's uid and NN are the next LS 5 bits.
(Only in the most dire circumstances would we change a UID, so that's not
an issue with us.)  For example:

pooh.cc> hesinfo janeane filsys
AFS /afs/iastate.edu/users/19/27/janeane w /home/janeane
pooh.cc> hesinfo janeane passwd
janeane:*:5755:101:,,,,:/home/janeane:/bin/tcsh

5755 = 101001111011
         \   /\   /
          \ /  \ /
          =19  =27

This gives us nice small directories down to the user:

pooh.cc> ls /afs/isu/users
00  02  04  06  08  10  12  14  16  18  20  22  24  26  28  30
01  03  05  07  09  11  13  15  17  19  21  23  25  27  29  31
pooh.cc> ls /afs/isu/users/19
00  02  04  06  08  10  12  14  16  18  20  22  24  26  28  30
01  03  05  07  09  11  13  15  17  19  21  23  25  27  29  31
pooh.cc> ls /afs/isu/users/19/27
atreptow  emanuele  havoc     jilleneh  mash      ptcullen  wwiese
brizious  fareway   hccheng   jsturges  mgruber   pwilliam  ylh
cjnelson  grau      janeane   lfevold   narcisus  rachelj

We also have a dir of symlinks (/afs/isu/usr/username) but that's
so slow it's hardly used.

He use the hesiod naming service (a minor extention of DNS) and
a program called "attach" (the original MIT version available
from athena-dist.mit.edu I should think) to do the lookup.

Attach does a lot of nifty things, but the major result is a
symlink from /home/username to /afs/isu/users/NN/MM/username
(looked up using hesiod).  Invoking attach as "detach" does
the expected thing.  Our /bin/login does an "attach username"
for the user.

By attaching/detaching as needed, /home stays fairly small
too:

pooh.cc> ls /home
OSFDOC       ftp          ispaid       milner       public       userve
compression  gcc          janeane      motd         pv-tech      www
decathena    ghost        john         news:rdb     tex          x11r5
emacs        gnu          jzelle       nfs1test     tigger       xfer
explorer     graphics     michaelv     olc          ultrix       xfig

Appended below is a run of our attach in debug mode so you
can sort of see what it does.

Hope this is some help,
John
------------------------------------------------------------------------------
config(janeane/axp) = Not Found
hesiod(janeane/axp) = Not Found
config(janeane) = Not Found
hesiod(janeane) = AFS /afs/iastate.edu/users/19/27/janeane w /home/janeane
janeane resolves to:
AFS /afs/iastate.edu/users/19/27/janeane w /home/janeane
Attachtab locked (1)
Freeing attachtab
Retrieving attachtab
Scanning attachtab for janeane entry
Attachtab entry for janeane not found
Setting lock on /tmp/attach_janeane: 6
Storing attachtab
Freeing attachtab
Unlocking attachtab (1)
Processing line: AFS /afs/iastate.edu/users/19/27/janeane w /home/janeane
mode is w, override is                          (ignored for AFS)
add option(soft)                                (ignored for AFS)
Making mountpoint for /home/janeane             (really a symlink for AFS)
execing /usr/athena/bin/aklog as:
aklog -path /afs/iastate.edu/users/19/27/janeane -zsubs
zsub: iastate.edu:root.cell
Adding zephyr instance iastate.edu:root.cell.
zsub: iastate.edu
Adding zephyr instance iastate.edu.
zsub: iastate.edu:users
Adding zephyr instance iastate.edu:users.
zsub: iastate.edu:user.janeane
Adding zephyr instance iastate.edu:user.janeane.
zsub: fs-5.iastate.edu
Adding zephyr instance fs-5.iastate.edu.
lstating /afs/iastate.edu/users/19/27/janeane
lstating /home/janeane
Mountpoint canonicalized as: /home/janeane
symlinking /afs/iastate.edu/users/19/27/janeane to /home/janeane
janeane: AFS mounted /afs/iastate.edu/users/19/27/janeane on /home/janeane (read-write)
Attachtab locked (1)
Freeing attachtab
Retrieving attachtab
Storing attachtab
Unlocking attachtab (1)
Freeing attachtab
Removing lock on /tmp/attach_janeane
Subscribing to 5 zephyr instances.
------------------------------------------------------------------------------
John Hascall                   ``An ill-chosen word is the fool's messenger.''
Systems Software Engineer
Project Vincent
Iowa State University Computation Center  +  Ames, IA  50011  +  515/294-9551

Reply via email to