SOLVED Symlink issues on SMB/CIFS share

hasirak

Dabbler
Joined
Apr 16, 2014
Messages
16
Hi guys, I am having some symlink issues with SAMBA and was hoping someone could give me some tips.

Problem description:
Symlinks are not working properly on my SMB share.
If I instead mount the dataset with SSHFS, then I can create symlinks normally with ln -s, and they function as expected.
But when I mount the SAMBA share with CIFS, the symlink does not appear on the file system.
I also get the following error when attempting to create a symlink on a the CIFS mounted share: ln: failed to create symbolic link 'test': Operation not supported
If I log in on the FreeNas box and use the shell to create a symlink using ln -s, then the symlink actually shows up on the CIFS mounted share, but it looks like a standard file. It does however seem to function as a symlink.

What I am trying to achieve:
I have mounted my dataset with SMB/CIFS under /mnt/archive. (this is working and I can browse, create and delete files)
I want a symlink in my home directory that points to a specific folder within that share. (this fails)
The reason I am using SMB is that I also want to be able to do something similar on a Windows PC, and I was hoping I could set up a single share that would work on both systems.

My setup:
I am running FreeNAS-11.3-STABLE with all updates installed. It's running on a small home server that is connected to my home network.
I have created an ACL on the dataset and given my user all privileges:
smb_share_acl.png

I have added the following auxiliary parameters to the SMB configuration:
smb_auxiliary_parameters.png

I have also restarted both the server and the client after applying these changes.

What is next:
Am I going about this the wrong way? Is this perhaps not possible with SMB shares? Or is this just some configuration error?
Should I perhaps instead switch to using only SSHFS or NFS on my Linux boxes? And then set up a separate SMB share for my Windows machine?

All tips and tricks are most welcome.
 
Last edited:

hasirak

Dabbler
Joined
Apr 16, 2014
Messages
16
Symlinks are now working. There were two issues.
I was missing the mfsymlinks option for the CIFS mount options in /etc/fstab.
There was also a problem with permissions, and applying the ACL recursively to the entire dataset seemed to fix it.

I am still wondering though, do anyone have suggestions to how I can improve my setup?
 

mjflower

Dabbler
Joined
Sep 14, 2020
Messages
25
Symlinks are now working. There were two issues.
I was missing the mfsymlinks option for the CIFS mount options in /etc/fstab.
There was also a problem with permissions, and applying the ACL recursively to the entire dataset seemed to fix it.

I am still wondering though, do anyone have suggestions to how I can improve my setup?
can you explain what you did with the mfsymlinks you refer to? having a similar iss ue and not sure now to fix, thanks :)
 

Kuro Houou

Contributor
Joined
Jun 17, 2014
Messages
193
Same issue. feel like this needs to be fixed in the default config in TrueNAS. not sure why you would want to be limited to just a couple directories for share paths.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

Kuro Houou

Contributor
Joined
Jun 17, 2014
Messages
193
The OP was able to get what they wanted with no change to TrueNAS.


a. you wouldn't want that
b. you aren't limited

Perhaps this will help with the mfsymlinks point: https://superuser.com/questions/1337257/clients-cant-create-symlinks-on-samba-share

Not sure what you mean, I have a fresh TrueNAS Scale install.. if I am not limited why do I get this error? If there is a argument I need to add to solve the issue thats another matter though. Is the fix just to add mfsymlinks?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
if I am not limited why do I get this error?
not sure why you would want to be limited to just a couple directories for share paths
Errors with symlinks have nothing to do with how many shares/share paths you can have.

Symlinks are not set to work by default as they can have complicating consequences if used. For people who understand what they are doing and want to do it anyway, there are ways to enable them.

To enable them, you need to set some of the additional parameters mentioned by the OP.

You may also need to set the mount statements on the clients (if they are non-Windows), which is where the post about mfsymlinks would apply.
 

Kuro Houou

Contributor
Joined
Jun 17, 2014
Messages
193
Ah I think this must not be the same issue as mine though. In truuenas scale I get the issue creating the share more then 1 layer deep on the dataset. The OP seems to have had an issue mounting the share. Sorry for the confusion
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
OK, I can reproduce the issue you're talking about.

That's a bug (or perhaps just a "feature" limiting you to only sharing datasets), so you can Report a Bug from the link at the top if you need it fixed.
 

Kuro Houou

Contributor
Joined
Jun 17, 2014
Messages
193
Top