About these pages

AFS in Windows

5 Aug 2009: a new version 1.5.60 of the client has just appeared and older ones no longer seem to work.  I followed the instructions G:\Applications\IBM\OpenAFS-1.5.60\CERNREADME.txt very carefully, including the Windows Hotfixes, and it seems to be OK for me.

As usual I have mapped the CERN AFS root to drive P: in Windows (if you use some my software, you should do the same).  I also map drive I: to my AFS home directory.

Adapted from my older notes for NT.  There are some other notes but I think they are now partly out of date.

The IBM AFS client for Windows allows direct access to AFS files from Windows.  Advantages: 

Almost everything works in the obvious way.  The root of AFS appears as drive P: in my setup.  As always in Windows, you can have command lines if you really want.. 

Warning: use of the AFS Client does not seem to be encouraged by the NICE support in CERN because earlier versions did lead to problems.  The latest version has gotten rid of those and I have not come across any others (except the business about Unix links mentioned below).   Just to say that I don't take responsibility - I wrote this page for my personal use and to save myself time when other people ask me about it (which has happened many times ....).

Notes on installing it in CERN

  1. If you have a new PC, use the administrator account to give yourself administrator privileges.
  2. Make sure your NICE and AFS passwords are the same.  (Not absolutely necessary but normally a very good idea.)
  3. Login as yourself, making the usual connection to NICE.
  4. Install the IBM AFS Client from Control Panel/Add/Remove Programs/Add New Programs/CD or Floppy/, browse to O: or G:\Applications\IBM\ and take the latest version.  Follow the instructions usually to be found in a .txt file.  What follows below was for an earlier version but I think the details remain more or less valid.
  5. You have to reboot.
  6. Click the little padlock item in your system tray, go to Advanced tab, Configure AFS client. The following pictures show my settings: 
  7. This shows my personal choice of drive letters, defined in the Drive Letters tab.  If you use some of the same software as I do, e.g., MAD with the LHC MAD optics database or Madtomma, then I strongly recommend that you map P: to the root of AFS as I do.


     

  8. You probably then need to get a token from the tokens tab.

The problems

Most problems seem to come from the AFS servers or the network, not the AFS Client.  On those days when AFS is having problems, it is a good idea to click the padlock, go to Advanced and just Stop Service while you do something else.

Unix links are dangerous

With the AFS client you have to be very careful with Unix links in the Windows explorer.  If you try to delete a link to a directory, it does not seem to work but you may actually delete the contents of the directory itself.   Be careful!

Most of the time, I avoid using Unix links and I wish others would too. When I really have to create them, which is much less often than many think, I give them the extension .link.

Renewing tokens

Click the padlock, to see how.

File permissions, quotas, etc.

Instead of having to remember those weird Unix commands like fs listquota you can right click a file or directory and use the AFS menu.

Files out of synch between Windows and Unix

You may occasionally find that changes made to a file on Windows are not seen immediately on Unix or vice versa.  This is a problem with the way AFS caches files, apparently.  To force an update, right click the file or directory in the Explorer, follow AFS/Flush File/Dir.

About AFS on a portable computer

When I first installed an earlier version of the AFS client on my laptop, I found that it caused problems when I disconnected from the network.  So for a while I was also careful not to include AFS files in synchronisations. 

However I have recently installed the latest version on my laptop portable computer.  Since the user account I use there is different from my AFS one, there is no automatic AFS access when I start up and the mapped drives appear with red crosses in My Computer to show they are not available.  When I do actually need it, I simply click the padlock in the system tray and obtain a token with the appropriate AFS account name and password.  Before disconnecting the laptop from the network, I simply stop the AFS service.  This works perfectly well for me.

Now (May 2004), I am getting a little more adventurous.   I have just tried making an AFS folder available offline using the Windows XP synchronization manager.   This seems to work fine.   If the laptop is disconected from the network, or the AFS client is not running, then I have offline access to the files.   As usual, it is important to pay attention to the little flashing computer icon in the notification area that tells you about offline changes that have not been synchronized.    So this is highly provisional but it would be very nice.    I am thinking about making the LHC optics MAD file database available offline for work with the Windows MAD-X.

In July 2004, there was a new version of the AFS Client G:\Applications\IBM\OpenAFS-1.3.70 which seems to deal with these things in a different, possibly better, way.  I h ave not quite understood it yet myself.  See the afs-install-notes.txt file and this useful FAQ.

Shortcuts

Besides the above drive mappings I created a Windows shortcut to my AFS home on the desktop.  It is better to right-click on this and Explore rather than working down from the P: drive in My Computer.  An additional folder on the desktop or in My Documents might contains shortcuts to important AFS directories  that I want to explore frequently, e.g.

Watch out however for other drive letters getting AFS assigned to them (this used to happen on NT ...).  This messes up shortcuts (it does not seem to happen any more). 

Upper and lower case in filenames

 It seems that Windows cannot tell the difference between a Unix directory called V5.0 and another called v5.0 (as in the LHC optics database).  This creates very confusing results.  Somehow it seems that Mathematica but not KEDIT can distinguish.  The Windows Explorer cannot.

Further useful sources of information on the AFS Client

A very useful FAQ page 

the infrastructure group @ csail

OpenAFS

DOS and Unix file formats

Nowadays,  the old problem of Windows file lines ending in <CR><LF> while Unix ones have only <LF> is almost irrelevant.  Most Windows programs don't care if a text file is in Unix format.  Here are some things I did years ago in order to be able to practically forget about it.  

KEDIT

KEDIT is my principal editor for plain text files.  I have made a permanent option
SET EOLOUT LF
so that it saves files in Unix format.  See Help EOLOUT in KEDIT.  It might very occasionally be necessary to reset to CRLF for certain files used by old Windows programs.  

KEDIT also works very well in AFS.   The DIR command provides a directory listing, sorting and navigation that is much faster and easier to use than Emacs'.

Mathematica

To convert a file from DOS to Unix format, I wrote a function in the JMJUtils`BumpEtc` package (loaded by default with my usual setup)

DOStoUnix["file"] changes the DOS line end characters in a file to Unix ones.
I often generate plain text files (e.g. MAD input)  with Mathematica.    Under Windows, the OpenWrite command has the options

In[909]:=Options[OpenWrite]
Out[99]=
{DOSTextFormat->True,FormatType->InputForm,PageHeight->22,
  PageWidth\->8,TotalHeight->\[Infinity],
  TotalWidth->\[Infinity],CharacterEncoding\[RuleDelayed]"ASCII",
  NumberMarks\[RuleDelayed]$NumberMarks}

so all you have to do is

SetOptions[OpenWrite,DOSTextFormat->False]
to set it generally or
OpenWrite[ ...., DOSTextFormat->False]
in a particular call.  For Mathematica read by itself it doesn't matter anyway.
 

Problem with skewed clocks

Not yet seen with Windows 2000, but let's keep the info here:

Subject:     AFS skew
Date:        Fri, 08 Jan 1999 11:10:41 +0100
From:        Hannes Schwarzbauer <Hannes.Schwarzbauer@cern.ch>
Organization:CERN. European Lab. for Particle Physics
          To:John.Jowett@cern.ch
>
>  Hello,
>       Today I cannot work on AFS files from Windows NT.  When I log in I
>  get the message that the server and client clocks are badly skewed.
>  This also precents me from authenticating to AFS by getting a token
>  manually.
>
>  I had this problem before at the switch from summer time. Resetting my
>  PC's clock fixed the problem.  However my PC appears to have the correct
>  time now so I don't know what to do.

> The 'AFS clock skew' problem has been seen elsewhere on several
> occasions, fortunately in all cases it has come down to the same quirk in
> Windows/NT setup:
>

JMJ
Latest modification: 05-Aug-09