Spotlight has had a pretty checkered past with Xsan. But things are looking a little better and if you want to try enabling it again, once you’ve fully updated to 2.2 you can do so without too much fanfare. Simply locate the config file for the name of the volume you wish to enable spotlight for, which is in /Library/FileSystems/Xsan/config and is named with the name of the volume followed by a .cfg file extension. Once located, open the file in your favorite text editor (ie – pico, vi, etc). Then, locate the entry for EnableSpotlight, which should be set to No. Change the No to a Yes.
You can also enable two different levels of searching:
To enable either, simply add a line below EnableSpotlight that reads similar to the following (based on the level of indexing you are comfortable with), starting with SpotLightSearchLevel and ending with the type of search you would like to perform:
Once enabled restart the service. While you shouldn’t, you may need to run mdutil (although you shouldn’t have to any more, but I’ve had to a couple of times) to get the spotlight indexing process kicked off. To do so run the mdutil command with the -E option, as you can see here (assuming a volume name of NAMEOFVOLUME):
mdutil -E /Volumes/NAMEOFVOLUME
You can then check the status of the indexing process using the -s option with mdutil, as follows(assuming a volume name of NAMEOFVOLUME):
mdutil -s /Volumes/NAMEOFVOLUME
mdimport -f /Volumes/NAMEOFVOLUME/MYPROJECTNAME
rm -ri /Volumes/NAMEOFVOLUME/.Spotlight-V100
Finally, if you wish to programmatically check that files have been indexed, you can use the mdfind command. This is especially helpful when comparing the results from an Xsan client and the current metadata controller in your environment.
krypted October 8th, 2009
Posted In: Xsan