D-Link Forums

The Graveyard - Products No Longer Supported => D-Link Storage => DNS-320L => Topic started by: hardworking on November 29, 2012, 04:23:57 AM

Title: Disable SMB for Macs only
Post by: hardworking on November 29, 2012, 04:23:57 AM
Hi All,

So I just bought and installed this 320L and want to know if there is a way I can get rid of Samba (SMB Sharing).  I run only Macs here and SMB is SO slow compared to AFP.

If I connect manually I get AFP, but if I use the link that appears in Finder it defaults to SMB  :(

Thanks
John
Title: Re: Disable SMB for Macs only
Post by: priitv8 on November 29, 2012, 01:52:59 PM
Hi,

There's probably a way to kill the smbd daemon (not via Web-GUI though), but I found it to be sufficient to stop the service advertising via Avahi (Bonjour on Linux) to be sufficient.
Indeed, I replaced it with AFP service advertisement to make connecting from Finder more convenient.
Title: Re: Disable SMB for Macs only
Post by: hardworking on November 29, 2012, 02:30:52 PM
Hi,

There's probably a way to kill the smbd daemon (not via Web-GUI though), but I found it to be sufficient to stop the service advertising via Avahi (Bonjour on Linux) to be sufficient.
Indeed, I replaced it with AFP service advertisement to make connecting from Finder more convenient.

Hi,

Thanks for the reply.  Can you please tell me how you did that?  I would be happy if the macs just don't see SMB and only see AFP, but I can't see how to do that.

Cheers
John
Title: Re: Disable SMB for Macs only
Post by: priitv8 on November 29, 2012, 10:15:57 PM
You will need to FunPlug the device to get access to it's command prompt and Linux filesystem.
As soon as you've installed Midnight Commander, you'll be working in a Norton Commander-like environment.
To achieve the desired result, I deleted samba.service and added proper afp.service to the proper folder
Code: [Select]
/etc/avahi/services
Title: Re: Disable SMB for Macs only
Post by: hardworking on November 29, 2012, 11:54:37 PM
Hmm... Ok.  Some research is needed.  :)

So in doing that, does the system still run the same, with the same GUI and functions etc?
Title: Re: Disable SMB for Macs only
Post by: priitv8 on November 30, 2012, 05:34:16 AM
So in doing that, does the system still run the same, with the same GUI and functions etc?
It will run with extended functionality (http://nas-tweaks.net/384/installation-of-twonky-server-7-on-nas-devices/) as a matter of fact. Standard UI & apps remain unchanged.
For research, I suggest you start here:
http://nas-tweaks.net/371/hdd-installation-of-the-fun_plug-0-7-on-nas-devices/ (http://nas-tweaks.net/371/hdd-installation-of-the-fun_plug-0-7-on-nas-devices/)
Title: Re: Disable SMB for Macs only
Post by: hardworking on November 30, 2012, 02:24:03 PM
Thanks man!! That's excellent!

Now I have it running, I need to see if I can install things like SabNZBD and Sickbeard.  :)

Cheers
-J
Title: Re: Disable SMB for Macs only
Post by: priitv8 on December 01, 2012, 12:35:42 AM
To make it even more Mac-like, you could also play with the _device-info._tcp key in the Avahi service definition. Mine looks like this and it is btw absolutely universal, because %h will advertise your set hostname:
Code: [Select]
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>
Now it looks like this in my Finder:
(https://lh6.googleusercontent.com/-l0DA6sD8ytY/ULnAhuAqexI/AAAAAAAAAe0/NNfyUB_hFeU/s320/Untitled.jpg)
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 01, 2012, 12:48:43 AM
Well, I have Sickbeard and Sab running.  I followed a tutorial online, although there was a fair bit of tweaking that I needed to do to get it to work, but its working now. :)

Now I just need to fix the whole AFP thing.  I am still not quite clear on what I need to do.
Title: Re: Disable SMB for Macs only
Post by: priitv8 on December 01, 2012, 02:01:04 AM
Now I just need to fix the whole AFP thing.  I am still not quite clear on what I need to do.
Well, to have AFP advertised via Avahi/Bonjour just copy the afp.service I listed above to /etc/avahi/services (it has to be called smth.services). That's it for making AFP connection visible for Mac.
To make this excercise survive reboot, you would need to find where /etc/avahi/services is stored on FLASH device and copy the file there (should be quite along the lines of store-password.sh from nas-tweaks), but I haven't bothered with this yet. I keep my NAS on 24/7.
Obviously, you need to enable afpd daemon under Application Management > AFP Service to serve AFP in the first place.
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 01, 2012, 02:45:40 AM
Quote
Well, to have AFP advertised via Avahi/Bonjour just copy the afp.service I listed above to /etc/avahi/services (it has to be called smth.services).

Sorry mate - I am not al that versed with Linux, and I am not sure I understand the above.  One second you call it afp.service, but then tell me it should be smth.services, so I am a bit puzzled.  :(

Sorry man - I am just not that skilled in Linux yet.

Can you please explain a bit better - Sorry.  :(
Title: Re: Disable SMB for Macs only
Post by: priitv8 on December 01, 2012, 11:25:28 AM
Sure.
1) you create the AFP service description XML file for Avahi (or copy mine from above)
2) you name the file afp.service. I think Avahi only cares about the file extension, which shall be .service, the name part needs to be unique within target folder
3) you copy your afp.service (self-descriptive names are easier) to /etc/avahi/services on your NAS. No need to reboot, Avahi picks it up on the fly
4) you delete samba.service file from the same directory so Bonjour will not confuse Finder with offering SMB. You have no official way to stop SMB service on NAS. I'm sure this can be taken care of via checking the startup scripts of NAS-Linux.

PS you might feel better after installing Midnight Commander (how-to on nas-tweaks site), then you can navigate around the filesystem as in good 'ol Norton Commander.
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 01, 2012, 01:42:35 PM
Thanks again!

Not sure if it's just me but I can't find any reference to Midnight Commander on the tweaks site??  ???

Also.. Are you talking about the FFP file system?  I can get to that with SSH, but I don't see the actual NAS OS?
Title: Re: Disable SMB for Macs only
Post by: priitv8 on December 01, 2012, 02:49:59 PM
I'm sorry, it was on another site, check the section titled INSTALL MIDNIGHT COMMANDER.
FFP7 makes it easy thanks to the slacker package installer.
http://bernaerts.dyndns.org/appliance/231-dns323-ffp7-install-funplug7 (http://bernaerts.dyndns.org/appliance/231-dns323-ffp7-install-funplug7)
The filesystem is a single one, if you ssh in as root, you will land in your home directory.
Change dir to root and you see the whole filesystem
Code: [Select]
cd /Then there's one more site worth having look at, although the DNS-320L is still too new to be found there:
http://dns323.kood.org/start?idx=howto (http://dns323.kood.org/start?idx=howto)
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 01, 2012, 02:55:55 PM
Ahh!  Ok.  Thanks.

I think I might have the wrong version on FFP maybe as I don't have an Avahi folder!  :(

AND... further to this, to get SickBeard and SabNZBD running I had to install Debian Squeeze.  So I don't think I can do this anyway.  :(

I searched everywhere and couldn't seem to find a way to run Sab and Sickbeard without installing Squeeze.  Unless you know - I could't find it anywhere.

Squeeze was pretty easy... but I just hate the Samba crap - not part of Squeeze though, it's obviously part of the original OS.  But I can't see any of those files.

When I navigate to /mnt/HD/HD_a2  I only see the FFP dir and the shares I have created, but no OEM OS files.  :(

I am SSHing into Squeeze now though, so maybe that is the problem.

Title: Re: Disable SMB for Macs only
Post by: priitv8 on December 01, 2012, 09:13:21 PM
When I navigate to /mnt/HD/HD_a2  I only see the FFP dir and the shares I have created, but no OEM OS files.  :(
That's 3 levels too deep! you need to back out to / !! There you will see etc alongside mnt and bunch of others.
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 01, 2012, 11:31:53 PM
Ahh!  Sorry - yes... I was getting confused as to where I was in the tree.  LOL!!

OK... I still don't have an /etc/avahi folder though!

I have done a fair bit of reading, but can't work it out.  The 320L supports AFP out of the box, I just wished I could get rid of SMB.  :(
Title: Re: Disable SMB for Macs only
Post by: priitv8 on December 02, 2012, 01:26:06 AM
OK, seems the OS version on 320L is a bit newer than on mine (325) and the location of the files might have changed.
SSH as root into command line and run the following command:

find / -name "samba.service" -print

And see if you can spot the location
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 02, 2012, 01:27:34 AM
Hmm... I got this reply...

root@Moses:/# find / -name "samba.service" -print
/mnt/root/etc/avahi/services/samba.service
find: File system loop detected; `/mnt/HD/HD_a2/squeeze' is part of the same file system loop as `/'.
Title: Re: Disable SMB for Macs only
Post by: priitv8 on December 02, 2012, 01:35:19 AM
OK, then you will rm the samba.service from /mnt/root/etc/avahi/services/ and cp your afp.service to the same place. MC makes it easier with F8 and F5 and visual feedback.
Seems that squeeze has created a circular reference in your filesystem. Why, whether it will hurt you later and how to fix, I unfortunately have no answer at the mo.
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 02, 2012, 01:42:58 AM
Ok - So far so good.

So I created a file called afp.service in /mnt/root/etc/avahi/services

I used the text you supplied!!  YIPPEE!!

You are a legend!!

I just checked with Get Info and I am not connecting using AFP!

THANK YOU SO MUCH!!!

How did you get the funky icon though?  Mine still shows a dodgy screen icon.
Title: Re: Disable SMB for Macs only
Post by: priitv8 on December 02, 2012, 02:27:57 AM
How did you get the funky icon though?  Mine still shows a dodgy screen icon.
That's the model=Xserve key in _device-info._tcp that Finder knows how to interpret.
<service>
   <type>_device-info._tcp</type>
   <port>0</port>
   <txt-record>model=Xserve</txt-record>
</service>


Try to restart Finder or sign off and back on.
You might also check under Network how does it show.
I have the 10.8.2 and it displays the correct device icon as soon as I copy afp.service to Avahi.
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 02, 2012, 02:36:26 AM
Hi,

Thanks.  Yeah not sure why it's not working.  Not too concerned, as it comes up at least.  :)

Here is what I get.  My NAS is called Moses.  (Don't ask)  LOL!!!

EDIT - SCRATCH THAT!!  It just changed!  Woo hoo!

Again... thanks mate!

Now I have everything running perfectly.

Cheers
John
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 06, 2012, 02:59:29 PM
Hmm... Just found out if I reboot the NAS, it dumps the new AFP.SERVICE and re-installs the Samba.Service.

Is this normal, and is there a way to fix this?

Cheers
John
Title: Re: Disable SMB for Macs only
Post by: priitv8 on December 08, 2012, 07:49:50 AM
Yes, that's what I said a week ago:
To make this excercise survive reboot, you would need to find where /etc/avahi/services is stored on FLASH device and copy the file there (should be quite along the lines of store-password.sh from nas-tweaks), but I haven't bothered with this yet. I keep my NAS on 24/7.
Problem is, NAS reloads all config files fresh from Flash storage during reboot.
Title: Re: Disable SMB for Macs only
Post by: hardworking on December 08, 2012, 03:18:49 PM
Ahh.  I see - I didn't quite follow that last post, but I get it now.

So this would be an easy fix!  I have some other things running in a script at startup for Squeeze such as Sickbeard and SabNZBD.  I could have it copy the afp.service to the folder, and then delete the samba file.

That might work.  :)