*New 11.3 series Release:
2019-10-05: XigmaNAS 11.3.0.4.6928 - released, 11.2 series are soon unsupported!

*New 12.0 series Release:
2019-10-05: XigmaNAS 12.0.0.4.6928 - released!

*New 11.2 series Release:
2019-09-23: XigmaNAS 11.2.0.4.6881 - released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

Indexing of SMB/CIFS/AFP fileshares from the client desktop (MacOS/Apple Mac OSX/OS-X (How to enable Spotlight)

NAS4Free & Apple Filing Protocol.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
Pu02
NewUser
NewUser
Posts: 11
Joined: 03 Jun 2016 13:34
Location: Melbourne, Australia +10
Status: Offline

Indexing of SMB/CIFS/AFP fileshares from the client desktop (MacOS/Apple Mac OSX/OS-X (How to enable Spotlight)

#1

Post by Pu02 » 12 Nov 2016 07:04

Hi all,

It was taking me forever and a day to search anything in my NAS4Free shares from my laptop. Looked into why, and found the solution was to setup indexing on the laptop, (which probably applies to any network share on any file-server, not just NAS4Free).

Often, a cache of files in each share is maintained locally on the file-server by a service that provides fast responses and metadata to processes querying file information locally, or possibly over the LAN. Maybe NAS4Free does it for SMB/Active Directory already (?), but in my case using Mac I couldn't find a way to make Apple's Spotlight work quickly- every time I ran a search it would take hours.

Now NAS4Free uses Netatalk to implement AFP shares, but there are no controls over indexing in the NAS4Free UI, nor a tracker daemon or dbus-dameon running anywhere, (all I can find is afpd). Perhaps it isn't obvious, but the features Spotlight needs may well not be configured or compiled into 10.3.0.3 - Pilingitam (revision 3105). Note to mods: Please forgive me if it is possible to make this work, I did hunt high and low but found nothing, yet this page seems to indicate it could be http://netatalk.sourceforge.net/3.1/htm ... 3878000704, at least with the current version of Netatalk (3.1) anyhow.

Because I really needed to be able to search my NAS quickly from this one machine, and there may be others that need to too, I'll share what worked below.

Note: Windows desktops might not have this trouble, but my copy of OSX did not automagically index any of my network shares, which meant that remote file-searches take hours and cause a lot of disk and network I/O. I remember in the old days it was not uncommon for users to configure their own client-based indexing services to stay up to date with network shares. Most OSs allow you to choose what local folders your service should watch or ignore, but under MacOS and later versions of OSX the Spotlight preference dialogue is full of vague groupings that probably relate to local folders only.

Anyhow, if you too are suffering slow file-searches, this might help you solve your problem:

** Caution! **
Spotlight stores its indexes and settings in a hidden folder on each volume/share. Before proceeding, you should be aware that enabling Spotlight on remote shares will mean that Spotlight and applications using these shares will store Spotlight metadata in hidden folders (.directories) in the normal BSD/'NIX way. As Mac uses see Windows desktop.ini files all over the place, Windows users may see these files in the share's root, not know what they are for and delete them, meaning that the index will become corrupt and need to be rebuilt. Such files do not respond well to direct manipulation. Instead, one must use the commands meant for manipulating Spotlight indexes: mdimport and mdutil or the API publishes to software developers.

On your workstation/laptop/client computer, access the share you want to search and index in a file browser (Finder/Explorer) window.
Now open your local indexing service configuration window:
- On a Mac, this is Preferences>Spotlight*
- On Windows, it is probably under Settings>Sharing or something or in the indexing service configuration
In the file browser, browse to your network share (Eg sharename/folder/subfolder). Drag the folder over (or otherwise add it) to your list of indexed folders.

Note:
Not all versions of Mac OSX support the addition of remote shares into Spotlight's list of indexed folders using the GUI (yes, seriously!)

In this case, here is how you add or remove them manually at the console:

Open a Terminal window from Applications>Utilities>Terminal:
1. Find the name of the network share you want to index with Spotlight
At the prompt, type:

Code: Select all

ls /Volumes
This will list all names of all the local volumes and remote file-shares your machine is connected to. Note which one you need to index.

2. Check the status of the indexing service to see if it is presently indexed, or not:

Code: Select all

>mdutil /Volumes/networksharename/ -i s
It should return Indexing disabled (or perhaps enabled).

3. Turn the indexing service on:

Code: Select all

>mdutil /Volumes/networksharename/ -i on
Note: To turn the indexing service off:

Code: Select all

mdutil /Volumes/networksharename/ -i off
You will notice background processes fire up in your OS during the indexing process (ps -ef, Activity Monitor, or taskmgr will list them as something like indexing service (windows) or mdworker (Mac))

Maybe this could be done better, but it works for me so far. Let us all know if it helps you!

To make the change permanent
If you want to maintain your share's Spotlight index between reboots, you must ensure the process is made persistent.
On Windows, you must make sure the indexing service is running and set to start up automatically in the services console.
On Mac and probably FreeBSD, this can be done by dropping it into your profile's crontab:

Code: Select all

crontab -e 
This starts the cron editor. Press i to change to insert mode, then type:

Code: Select all

mdutil /Volumes/path/to/your/share -s 
... and press the esc key.

Now type:

Code: Select all

:wq! 
to write the file and exit out of the editor.

This change makes your system periodically check that Spotlight is maintaining your network share's index (providing you are logged in)
LGA1150 Xeon E3-1220Lv3 || 32GB Unbuffered DDR3L-1600 || System on USB3 || Intel C224 via software RAID and 4 disk backplane
HP ML10v2 Xeon E3-1220Lv3 || 32GB Unbuffered DDR3L-1600 || System on SAnDisk Extreme || HP controller w software RAID and 3+1 disk backplane

vicmarto
NewUser
NewUser
Posts: 13
Joined: 19 Apr 2016 02:37
Status: Offline

Re: Indexing of SMB/CIFS/AFP fileshares from the client desktop (MacOS/Apple Mac OSX/OS-X (How to enable Spotlight)

#2

Post by vicmarto » 26 Jan 2017 15:18

Thanks Pu02 for the How To. Unfortunately can't get it to work in my Mac and Nas4Free.

Researching about Spotlight support in Netatalk, and its state in Nas4Free, get this from my Nas4Free installation (v. 10.3.0.3 - Pilingitam (revision 3379), but tried other versions with identical results):

Code: Select all

$ netatalk -v
netatalk 3.1.10 - Netatalk AFP server service controller daemon

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. Please see the file COPYING for further information and details.

netatalk has been compiled with support for these features:

 [b]    Spotlight support:	No[/b]

                  afpd:	/usr/local/sbin/afpd
            cnid_metad:	/usr/local/sbin/cnid_metad
              afp.conf:	/usr/local/etc/afp.conf
    netatalk lock file:	/var/spool/lock/netatalk
And this:

Code: Select all

$ afpd -V
afpd 3.1.10 - Apple Filing Protocol (AFP) daemon of Netatalk

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. Please see the file COPYING for further information and details.

afpd has been compiled with support for these features:

	AFP versions:			2.2 3.0 3.1 3.2 3.3 3.4 
	CNID backends:			dbd last tdb 
	Zeroconf support:		No
	TCP wrappers support:		No
	Quota support:			No
	Admin group support:		Yes
	Valid shell checks:		Yes
	cracklib support:		No
	EA support:			ad | sys
	ACL support:			Yes
	LDAP support:			No
	D-Bus support:			No
	Spotlight support:		No
	DTrace probes:			No

              afp.conf:	/usr/local/etc/afp.conf
           extmap.conf:	/usr/local/etc/extmap.conf
       state directory:	/var/db/netatalk/
    afp_signature.conf:	/var/db/netatalk/afp_signature.conf
      afp_voluuid.conf:	/var/db/netatalk/afp_voluuid.conf
       UAM search path:	/etc/uams//
  Server messages path:	/var/db/netatalk/msg/

Seems like Netatalk Spotlight support is disabled in Nas4Free :o :cry:

And can't be enabled easily, because must be done at the compilation step, according to Netatalk manual: http://netatalk.sourceforge.net/3.1/htm ... ht-compile

And finally, how to enable it: http://netatalk.sourceforge.net/3.1/htm ... 3878000704

Would be very very useful to get a working Netatalk installation in Nas4Free for Mac users, this is what I most miss with the switch to Nas4Free as my storage platform. Please please developers, take it in consideration.

Can open a request in NAS4Free GitHub Repository if needed.


And... A few more useful guides about compile and install of Netatalk with Spotlight support can be find here: http://netatalk.sourceforge.net/wiki/in ... ory:Howtos

Pu02
NewUser
NewUser
Posts: 11
Joined: 03 Jun 2016 13:34
Location: Melbourne, Australia +10
Status: Offline

Re: Indexing of SMB/CIFS/AFP fileshares from the client desktop (MacOS/Apple Mac OSX/OS-X (How to enable Spotlight)

#3

Post by Pu02 » 27 Jan 2017 02:10

Thanks vicmarto for looking deeper. That sure explains why it all has to be done client-side.

Agree with you, let's look at what needs to be done to enable/configure this in NAS4free. I'll take a look at the links you popped up when I get back from work, and will post anything I can come up w that might help.

Glad someone else out there is using Mac w their NAS4free :?: :!:

Let's see if there is any way we can help get this implemented.
LGA1150 Xeon E3-1220Lv3 || 32GB Unbuffered DDR3L-1600 || System on USB3 || Intel C224 via software RAID and 4 disk backplane
HP ML10v2 Xeon E3-1220Lv3 || 32GB Unbuffered DDR3L-1600 || System on SAnDisk Extreme || HP controller w software RAID and 3+1 disk backplane

Peta
NewUser
NewUser
Posts: 9
Joined: 15 Jun 2017 12:55
Status: Offline

Re: Indexing of SMB/CIFS/AFP fileshares from the client desktop (MacOS/Apple Mac OSX/OS-X (How to enable Spotlight)

#4

Post by Peta » 20 Jun 2017 08:22

Pu02 wrote:
27 Jan 2017 02:10

Glad someone else out there is using Mac w their NAS4free :?: :!:
:mrgreen:

Are there any news about enable spotlight for afp shares? I'm running NAS4Free 11.0.0.4.4303 and macOS Sierra 10.12.5
HPE ProLiant MicroServer Gen8 G1610T || HPE 16GB ECC RAM || HPE Flash Kit 8GB || LSI SAS 9211-8i (IT mode) || 4x WDC RED WD40EFRX 4TByte || 4x Samsung 860 Evo 256GByte || XigmaNAS 11.2.0.4 - Omnius (Revision 6766) embedded

Pu02
NewUser
NewUser
Posts: 11
Joined: 03 Jun 2016 13:34
Location: Melbourne, Australia +10
Status: Offline

Re: Indexing of SMB/CIFS/AFP fileshares from the client desktop (MacOS/Apple Mac OSX/OS-X (How to enable Spotlight)

#5

Post by Pu02 » 03 Jul 2017 14:12

I wish it did too, but am guilty of not getting back to look at this. I or someone needs to look at how I can make non-UI config changes to NAS4Free and spend time testing if it can be made to work, it has been done before on BSD though http://netatalk.sourceforge.net/wiki/in ... on_FreeBSD
LGA1150 Xeon E3-1220Lv3 || 32GB Unbuffered DDR3L-1600 || System on USB3 || Intel C224 via software RAID and 4 disk backplane
HP ML10v2 Xeon E3-1220Lv3 || 32GB Unbuffered DDR3L-1600 || System on SAnDisk Extreme || HP controller w software RAID and 3+1 disk backplane

Pu02
NewUser
NewUser
Posts: 11
Joined: 03 Jun 2016 13:34
Location: Melbourne, Australia +10
Status: Offline

Re: Indexing of SMB/CIFS/AFP fileshares from the client desktop (MacOS/Apple Mac OSX/OS-X (How to enable Spotlight)

#6

Post by Pu02 » 24 Oct 2018 03:45

Behaviour on current XigmaNAS implementations is pretty good.

For a share to work as it should with MacOS, you need to create your fileshares under Services > AFP > Shares

Then connect using your various networked MacOS clients. These may automatically index the share once they get a chance (eg if you leave them connected long enough), and if those clients mount the shares in /Volumes, like macOS does by default). After disconnection and later re-connection to that same share later on, the client's index should update itself without user involvement

So MacOS's Spotlight may do this automatically now. Not sure if it works for SMB or NFS shares- would be good to know if so- it is important functionality that users working with macs need to understand

NB. I still need to confirm this is not a previous persistent setting I've forgotten about.
LGA1150 Xeon E3-1220Lv3 || 32GB Unbuffered DDR3L-1600 || System on USB3 || Intel C224 via software RAID and 4 disk backplane
HP ML10v2 Xeon E3-1220Lv3 || 32GB Unbuffered DDR3L-1600 || System on SAnDisk Extreme || HP controller w software RAID and 3+1 disk backplane

Post Reply

Return to “AFP”