How to get Domain and workgrourp shares mapped to external NAS

NethServer Version: 7.3 RC3
Module: Domain Controller, shares

Folks, seeing some good things on 7 RC3 (with a few reservation the wizard and sssd.conf file being deleted upon creation of a domain). One thing that would awesome and I’m trying to do manually, is to map the Samba default shares given to newly created profiles as well as group (or LDAP) share mapped to an external NAS. (Freenas to be exact). there are reasons for this. Storage space being the biggie. I have a fstab entry to auto mount a profile share on Freenas which work perfectly. How can I get Samba to use that mapped directory to store the user default share location as well as get the custom shared folders mapped to that NAS share mount as well. Had a line:

template homedir /nasuserdata/%WORKGROUP%/ACCOUNTNAME%

entered in smb.conf to get profile data/user shares located there but when I did an update to my DNS entries using the web interface it disappeared. I realize this line may not be the best approach. Any ideas on how I can achieve this in more elegant/effective manner? thanks!

What we support in the gui, out of the box, are shares that are created here; /var/lib/nethserver/ibay from the gui. What you will need to do is created a template that will allow you to point to your nas shares. Other’s will have to chime in on the how because I’m still weak in my knowledge of template application.

I’d rather change the server configuration to mount the NAS partition directly to /var/lib/nethserver/ibay.

Cool, this is perfect. Thank you

Folks tried using mount bind in the fstab to map /var/lib/nethserver to a copy I created on my nas directory. But services fail when I try to do th is. I can use fstab to map the ibay directory but I also want to the default profiles shares to be mapped to the NAS. I tried using fstab to map the var/lib/nethserver/home to my mounted nas directory/nethserver/home directory (overriding the /var/lib/nethserver/home ->/home default) but services fial when I do this. I’ve gone over the template system. The articles I read on it are a bit vague and (and it appears to be MANY layers). Any ideas on how to get all samba user storage directories to the NAS. I’m reluctant to change the base in the templates/etc/samba/smb.conf at the the 00template_vars or the 10base files. I did see mention of the templates-custom files but cannot find concrete examples as to the structure (must match identical to "/templates/etc/(x)/…?) Any pointers here…?

Oh, this nethserver 7 RC3 in case you are wondering.

Even my mapping in fstab to ibay fails. Here is my fstab entry:

//(servername)/homes    /nasuserdata     cifs   credentials=/root/freenas_drive,vers=3.0,_netdev,comment=systemd.automount,sec=ntlm.file_mode=0775,dir_mode=0775   0 0
/nasuserdata/nethserver/ibay /var/lib/nethserver/ibay      none    defaults,bind    0 0

sometimes the security service fails along with httpd and samba. The only thing that gets the system to start all services correctly is to set the fstab remapping for ibay back. Any ideas?

Oh, my cifs mount works perfectly. It’s the ibay mapping that seems to fail some internal system check.

I THINK I have this sorted out. 2 possible issues. First, I needed to run “signal-event fstab-update”. Part of the problem may have been a latency issue on the FreeNAS server i was mounting using cifs. Here is my fstab entry. It seems to be working now:

/dev/mapper/VolGroup-lv_root / xfs defaults,acl,user_xattr 0 0
/dev/mapper VolGroup-lv_swap swap swap defaults 0 0
//(server name)/homes /nasuserroot cifs credentials=/root/freenas_drive,vers=3.0,_netdev,comment=systemd.automount,sec=ntlm,file_mode=0775,dir_mode=0775,uid=0,gid=0
/nasuserroot/nethserver/ibay /var/lib/nethserver/ibay none defaults,bind 0 0
/nasuserroot/nethserver/home /var/lib/nethserver/home none defaults,bind 0 0

Hope that is useful for anyone looking to do this. If this is a bit of a hack and someone knows a better way, please post it here so we are all the wiser. Thanks all.

1 Like