Linux @ CERN

CERN > IT > Linux

Mounting CERN DFS file system on linux

CERN uses Microsoft DFS file system for storing users and application data for Windows systems.

This documentation outlines the setup process allowing Linux clients to mount and access CERN DFS file system.

While the initial installation of required software is specific to CERN SLC6 Linux distribution, following configuration steps shall be applicable on any modern Linux platform, providing it features cifs-utils version 4.8.1 or newer and kernel version 2.6.38 or newer, or a patched cifs kernel module on older kernels (see the patch discussion here).

Software installation

As root on your fully updated (if in doubt, execute as root: yum update...) SLC6 system run:
# yum  install cifs-utils  kernel-module-cifs-`uname -r`
(As of SLC 6.3 - kernel 2.6.32-279.el6 an additional cifs kernel module is not needed, the in-kernel one works correctly)

Configuration

As root on your system:

Please verify that your host keytab is valid:

# klist -k
it should show output similar to:
Keytab name: WRFILE:/etc/krb5.keytab
KVNO Principal
---- --------------------------------------------------------------------------
  10 host/yourhost.cern.ch@CERN.CH
   9 host/yourhost.cern.ch@CERN.CH
   1 host/yourhost.cern.ch@CERN.CH
(actual output may vary depending on when and how keytab was set)

Edit /etc/request-key.conf and add following lines at the end:

# added for CIFS 
create  cifs.spnego    * * /usr/sbin/cifs.upcall %k
create  dns_resolver   * * /usr/sbin/cifs.upcall %k
Create mountpoint:
# mkdir /dfs
Create /etc/cron.d/host-kinit file with following content:
#This cron job will reacquire host credentials every 12 hours
01 */12 * * * root /usr/bin/kinit -k

Filesystem mount

Please choose one of the following two methods on your system.

Mounting with other filesystems

Edit /etc/rc.local and insert there these lines:
# Mount DFS
/usr/bin/kinit -k
/bin/mount /dfs
Edit /etc/fstab and add at the end this line:
//cerndfs.cern.ch/dfs   /dfs            cifs    noauto,nocase,sec=krb5,multiuser,uid=0,gid=0    0 0
Next, execute:
# /etc/rc.local
On subsequent system reboots DFS will be mounted automatically.

Mounting with automounter

Edit /etc/auto.master and add following line:
/dfs/ /etc/auto.dfs
Create /etc/auto.dfs with following content:
#!/bin/sh
[ !`/usr/bin/kinit -k 2>&1 >> /dev/null` ] && echo " -fstype=cifs,sec=krb5,multiuser,user=0,uid=0,gid=0 ://cerndfs.cern.ch/dfs/&"
Execute:
# chmod 755 /etc/auto.dfs

To finish the configuration please enable and restart the automounter:

# /sbin/chkconfig --levels 345 autofs on
# /sbin/service autofs restart
Note: The DFS filesystem is automounted: therefore until user accesses it nothing is visible under /dfs/: try ls /dfs/Users or ls /dfs/Applications to see the content.

Usage notes