Link to home
Start Free TrialLog in
Avatar of DanRaposo
DanRaposoFlag for United States of America

asked on

Ho can I get a CIFS mount to follow symbolic links?

I have a CIFS share running on both Ubuntu and RHEL (6) ...   Users are trying to run SVN checkouts but are getting errors following symbolic links.   How can I properly mount this so that this is possible?  

I know that windows shares don't natively support symbolic links, but it seems from reading online that there are ways to make this happen.  I haven't figured it out yet however.


Any htoughts?  Does it need to be mounted differently?  Does a package need to be installed ?  

Any step by step help would be greatly appreciated.



Thanks
Avatar of farzanj
farzanj
Flag of Canada image

Avatar of skullnobrains
skullnobrains

you can ask samba to follow symlinks but the windows machines will not be aware that they are following links and see the links as regular files and folders. beware that some software will delete a file and rewrite it when they need to edit the file which will not work as expected if the file is a symbolic link : the link will be deleted and a new file created independent of the file the link used to reference.

btw, linux does not actually support true symbolic links at all, but rather use extended hardlinks.
If the links are pointing to something outside the CIFS share there is no chance to get them resolved.
Avatar of DanRaposo

ASKER

The links are all self contained wihtin the CIFS share.   It is stuff like ../filename
did you try anything since the thread was started ?
options relative to symbolic links are the following in smb.conf
follow symlinks = yes/no
wide links = yes/no # no disables links outside of the mounted filesystem

like i said before, windows will ot be aware that the files are actually symlinks

if you still have a problem, please post the command you launch and the errors you receive.
"errors following symbolic links" is a bit vague to say the least
Yes.  Sorry I typed in a reply, but got sidetracked and didn't realize I never sent it.


//server1/users   /users       cifs    credentials=/etc/.cifscredentials,user,iocharset=utf8,file_mode=0777,dir_mode=0777,gid=users 0 0

I have tried adding the user option as above

//server/users   /users       cifs    credentials=/etc/.cifscredentials,iocharset=utf8,cifs.symlinks.enable,file_mode=0777,dir_mode=0777,gid=users 0 0

I have also tried adding cifs.symlinks.enable   as above

Both of these changes are to the fstab.

my understanding is by default cifs.symlinks.enable should have been enable din the first place.


When checking out SVN code we get


A    web/mod/views/editEmp.php
svn: In directory 'web/mod/views'
svn: Can't create symbolic link 'web/mod/views/v_freeplay_reports.php.tmp': Operation not supported
creating a symlink over CIFS is not supported at all in the basic protocol

you'd need the unix extensions to be activated both client and server side
since mount_cifs features a nounix option but no unix option, i assume this is the default client-side

what soft do you have server-side ? if it is samba, you need to remove other rules mentionning symlinks and to add this "unix extensions = yes " in your smb.conf

why don't you use nfs if you're running unix machines ?

btw, cifs.symlinks.enable is something you would use on a netapp server but definitely not in your fstab
We are using a SAN and not a NAS.  I can have either windows or linuc host and serve up the file partitions, but since the data that they wanted to access was already being served up by windows, I though the CIFS route would be the easiest to take.  

Clearly it appears this was not a good decision.   I can use nfs, but that comes with additional complications.    In the end I was looking for an easy to setup and manage solution.



Thanks
ASKER CERTIFIED SOLUTION
Avatar of skullnobrains
skullnobrains

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for all your help.  I think the best solution is for me to remap as an NFS file system, but I will use linux as the host.   I have learned a lot abut the limitations of CIFs, windows and symbolic links.   I appreciate all the advice.   I will accept NFS as the solution as that seems to be the best fit to my particular needs.