meta data for this page
  •  

This is an old revision of the document!


Back to #itlab main page

Migration to CIFS

As smbfs is unsupported and being removed from the Linux kernel (LKML: deprecate-smbfs-in-favor-of-cifs.patch) we should be migrating to using CIFS instead.

If you previously had smbfs mounts configured in fstab and you use local user database, i.e., administer your own workstation, the migration is not trivial. Most of the Samba servers here seem to support CIFS Unix extensions, meaning that mount options uid, gid, dmask, fmask, file_mode, dir_mode do not work. The UID, GID and file access permissions come from the server as is, and probably they are not the same you want to have on your workstation.

The solution is to forget fstab, and mount the shares as a normal user under your home directory using option noperms. Noperms disables local file access permissions checking, so the local UID, GID and permissions information can be whatever, they are ignored. You have to mount under your home directory to prevent other users on your workstation from using the shares you mounted. Otherwise they would have your identity and access rights on the share. So make sure only you can access the mount points.

Alternative Option

If you really want to have the same UID/GID semantics as in smbfs, do this:

echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled

It disables the Unix extensions on client side.

How to Mount

The general form is:

mount.cifs <i>/server/share</i> <i>mountpoint</i> -o noperms,user=LUT/<i>username</i>

For umount you must use umount.cifs command. It seems to need the absolute path to mount point, otherwise it leaves a stale entry in /etc/mtab.

Servers

Supporting Unix extensions

  • regulus.it.lut.fi
  • diso.it.lut.fi

No Unix extensions

For these servers you may want to set mount options dir_mode=00700,file_mode=00600.

  • kynnys.pc.lut.fi
  • files-tite.cc.lut.fi

Examples

pq's cmount script

http://mediaserver.it.lut.fi/media/linux/cmount

The script has server configuration inside it, and the shares come from directory structure. Here is an example directory structure:

.
|-- diso
|   |-- kurssit
|   |-- project
|   `-- www
|-- files-tite
|   |-- HOME
|   `-- tite
|-- mediaserver
|   `-- media
|-- regulus
|   |-- project
|   `-- users
`-- ti500433
    `-- install

Mounting works by ./cmount diso/www and umounting must be done by ./cmount -u diso/www or otherwise the mount may not be removed properly from mtab even though it is really unmounted.