Samba, CIFS and Symlinks

| No Comments

I recently moved all my client workstations over from using NFSv4 mounts to CIFS mounts so as to integrate with U of MN Active Directory a bit better.

As with all migrations, I ran into a snag! When the user's Documents folder is mounted at their login using pam_mount via mount.cifs, symbolic links tend to break. Not all of them, only links with absolute path names on the server.

For example, here's a client's view of a file that's mounted

ls -l
l????????? ? ? ? ? ? .Rprofile

But on the server it looks like this:
ls -l
lrwxrwxrwx 1 user domain users 34 2011-09-13 09:01 .Rprofile -> /home/AD/user/r/r_tools/.Rprofile

So to solve this you have to go through and replace all absolute symbolic links with relative symbolic links. I wrote a bash script to do such a thing as I had too many to do by hand, but if you don't have too many, you can fix them by hand.

To find all symbolic links under the directory /search/base:

find /search/base -type l

To find all broken symbolic links under the directory /search/base:

find -L /search/base -type l

Good Luck!

Leave a comment

About this Entry

This page contains a single entry by Aaron Zirbes published on September 13, 2011 1:41 PM.

MySQL and SSL was the previous entry in this blog.

Configuration Manager Jealousy is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.