Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Apple Software > Windows on the Mac
TouchArcade.com - iPhone Game Reviews and News

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 13, 2006, 04:04 AM   #1
mrichmon
macrumors 6502a
 
Join Date: Jun 2003
Preventing Spotlight from indexing an NTFS partition

I've recently installed Windows on an external USB drive (after modifying the Windows install CD). This works great, except that everytime I connected the external drive to OS X Spotlight would traverse the entire NTFS partition to index it. The traversal would take about 10 minutes during which I could not unmount the drive.

I needed to find a way to prevent Spotlight from indexing this drive since I don't need to search into my Windows installation.

At first I tried preventing the NTFS partition from mounting at all. This made sense since the external drive also has a small FAT32 partition for sharing data between Windows and OS X. Using an entry in the /etc/fstab I was able to prevent the NTFS partition from mounting without any difficulty. The drawback with this approach was that the Startup Disk preference panel would not see the Windows installation since the partition wasn't being mounted.

The Startup Disk preference panel drawback is significant because with Windows installed onto an external drive the only way I have found to boot into Windows is to set the Startup Disk using the preference panel. (And to set the Startup Disk back to OS X using the Startup Disk control panel.) The key combination on boot to boot from an external drive does not trigger a boot into windows as far as I can tell.

After reversing the fstab entry I found a second approach that prevents Spotlight from indexing the NTFS drive while still mounting the partition thus allowing the Startup Disk preference panel to see the partition.

The solution is to create a .Spotlight-V100 file on the NTFS partition so that Spotlight thinks it has already indexed the partition but cannot write to the index (since OS X cannot write to an NTFS filesystem). The result is that Spotlight aborts the index creation. The tricky part is that OS X cannot write to NTFS partitions and Windows refuses to let you create a file or directory if the name starts with a '.' character.

Instead, you can create an empty file in OS X with the correct name then zip up the file and transfer it to a Windows machine (or reboot into Windows) and then unzip the archive into the root of the NTFS partition.

You can use TextEdit to create an empty file in OS X and then archive the file using the finder, or you can open the Terminal and use the following commands to create the zip file:

Code:
cd ~/Desktop
touch .Spotlight-V100
zip spotlight.zip .Spotlight-V100
rm .Spotlight-V100
Copy the zip file to somewhere that you can access from Windows. Boot into Windows and unzip the zip file into the top level of your NTFS partition. Next time you boot into OS X Spotlight will not index the NTFS partition.
mrichmon is offline   Reply With Quote
Old Jul 13, 2006, 12:56 PM   #2
dollarsai
macrumors member
 
Join Date: Jul 2006
Nice find, Tx. I was expecting something like this.
I would search for "applications" in spotlight and it would show me application data from the Windows partition. Gee!!!
__________________
Macbook 13" ~ Blackbook 2Ghz / 80GB / 2GB
iPod Photo 30GB

OS X Tiger
Windows Vista Bulid 5384 (Aero)

Once you go Mac, You'll never go back
dollarsai is offline   Reply With Quote
Old Jul 14, 2006, 12:15 PM   #3
weldon
macrumors 6502a
 
Join Date: May 2004
You didn't mention it so I have to ask...

Did adding the NTFS volume to the privacy list not work? I would think that would be the easiest and most reliable solution if it works with external volumes.
weldon is offline   Reply With Quote
Old Jul 14, 2006, 02:43 PM   #4
mrichmon
Thread Starter
macrumors 6502a
 
Join Date: Jun 2003
Quote:
Originally Posted by weldon
You didn't mention it so I have to ask...

Did adding the NTFS volume to the privacy list not work? I would think that would be the easiest and most reliable solution if it works with external volumes.
Adding the NTFS volume to the privacy list does not work since you cannot add the Volume to the privacy list. Using mdutil to turn indexing off for the NTFS volume also does not work.

Using mdutil to turn off indexing results in a change being written to the .Spotlight-V100 index data folder on the volume for which you are disabling indexing. I suspect that altering the privacy list also ends up writing a change to the .Spotlight-V100 index folder on the volume being modified. Since OS X cannot write to NTFS then these changes cannot be recorded on the volume.
mrichmon is offline   Reply With Quote
Old Aug 1, 2006, 12:49 AM   #5
CDN
macrumors newbie
 
Join Date: Jul 2006
I've recently encountered the Spotlight indexing problem and attempted the solution provided by mrichmon.

Here are the exact steps I took:

1) Copied the code provided by mrichmon into the Terminal, which produced a .zip file on the desktop.
2) Copied the .zip file to a flash drive
3) Booted into Windows, and unzipped the .Spotlight-V100 file into the C:/ drive (alongside the Windows folder, etc.)
4) Rebooted into Mac OS X, and tried a spotlight search for Thunderbird (which is on my Windows partition, but not my OS X partition)

This search returned the files that are listed on my Windows partition . . . what did I do incorrectly?

Thanks,
CDN

Last edited by CDN : Aug 1, 2006 at 10:09 PM.
CDN is offline   Reply With Quote
Old Aug 6, 2006, 08:28 PM   #6
MARIKAVSx
macrumors newbie
 
Join Date: Aug 2006
Thumbs up XP spotlight fix

Quote:
Originally Posted by CDN
This search returned the files that are listed on my Windows partition . . . what did I do incorrectly?

Thanks,
CDN
When the first pass (using mrichmon 's suggestion) didn't work I cleared the spotlight index thinking there would be old stuff left in there. (You have to drag the whole HD, not just any folder like they tell you, into Privacy and then remove it.) When that didn't work either I moved the dot-file itself from the spotlight folder onto the root of Windows (C:\) - Windows didn't object - and figured I had it made. I then re-cleared the spotlight index. On the first search I did I still got the Windows entries, but the second time around (same search word) it worked! So who knows, maybe it would have been sufficient to just run the search twice the first time... Try it, maybe it'll save you some time.
Take care,
MvS
MARIKAVSx is offline   Reply With Quote

Reply

Mac Forums > Apple Software > Windows on the Mac

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:01 AM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2002-2009, MacRumors.com, LLC