# Trying to run openAFS client

## avitase

Dear Experts,

I have installed openAFS (client & server) successfully but am I not able to run the Client.

Starting the client

```
> /etc/init.d/openafs-client start
```

results in:

```
 * Starting OpenAFS client ...

 *   OpenAFS already active, trying to unload module

 *   Loading OpenAFS kernel module ...                                                                [ ok ]

 *   Starting OpenAFS daemon ...                                                                      [ !! ]

 * ERROR: openafs-client failed to start
```

I found out, that after starting the openAFS daemon 

```
/usr/sbin/afsd -fakestat -stat 2000 -dcache 800 -daemons 3 -volumes 70  -afsdb -dynroot
```

 gets called.

Running this command produces the following error:

```
afsd: ERROR: Cache dir check failed (unable to stat cache base directory)
```

The (Gentoo-)Wiki mentions problems using ext4. I have running solutions on RedHat systems using ext4 purely and I also tried to move the log to an ext2 device but still the same error occurs.

I have set ThisCell also:

```
> cat /etc/openafs/ThisCell 

cern.ch
```

Can anyone help me?

Thanks a lot

----------

## depontius

 *avitase wrote:*   

> 
> 
> Running this command produces the following error:
> 
> ```
> ...

 

Forgive me if you've already checked this, but this looks as if it might be quite simple.  Does your cache directory exist?  The cache directory and its size are specified in "/usr/vice/etc/cacheinfo".  I don't believe the openafs install creates it, but I'm not sure.  I've always used a separate partition for my openafs cache.  To be honest, I don't think I've read the Gentoo OpenAFS Wiki, at least not in my memory horizon.  I make my afs cache ext4 with no journal.  There are benefits to doing it that way.  Once upon a time I came across other filesystem tuning suggestions for an afs cache, but at this point I forget them, and the biggest benefit comes from ext4's extents.

----------

## khayyam

 *avitase wrote:*   

> 
> 
> ```
> afsd: ERROR: Cache dir check failed (unable to stat cache base directory)
> ```
> ...

 

avitase ... I'm completely unfamilar with openafs but I suspect the reason for the above is that no  tmpfiles.d is configured. So, do you have tmpfiles.setup and tempfiles.dev in some runlevel (I forget which), and does /etc/tmpfiles.d/ contain some config for openafs-client?

Note that the openrc reimplementation of systemd's tmpfiles.d is entirely compatible with the above linked manpage.

best ... khay

----------

## depontius

I just took another look at the ebuild.  I haven't run afs on Gentoo since my employer moved to a standard Linux and prohibited others.  Instead of "/usr/vice/etc/cacheinfo", where I first pointed you to, look in "/etc/openafs" for the "cacheinfo" file.  As far as I can tell, the default cache location is "/var/cache/openafs", but it doesn't appear to do anything about creating that location for you.  I believe that is your problem.

One other note, to head off the next problem you'll run into.  The "cacheinfo" file specifies the size of the cache.  If you want to use a cache partition, which I would recommend, you can of course mount it at the indicated location.  BUT there is overhead to the cache, so you can't make the cache the same size as the partition size, it needs to be a little bit bigger.  I apologize for not being able to tell you what "a little bit" is, but it's been five or ten years since I set up a Gentoo OpenAFS client.  One other warning about this - if the partition is undersized, it will fail with no symptoms or messages.  That's because the initscript sends (or sent, last I used it) stdout and stderr to /dev/null.  I debugged this by tweaking the initscript to direct them to a file - the messages were right there.

----------

## avitase

thanks a lot!

```
mkdir /var/cache/openafs 
```

indeed fixes the problem!

Also thank you for your warnings.

----------

