1

I don't need spotlight. I read this:

Can't locate /.Spotlight-V100 anywhere, spotlight has incomplete results even after index rebuild

Here's a picture of my spotlight thing, which was only visible when I paid the $10 for daisydisk

daisy disk When I double click down on this thing it has files like dbStr-2.map.data which is 189gb etc, but on the internet it says to never delete file that start with dbStr... because the mac will be irreparably ruined. I'm a PC guy, let's be honest. So, can I just drag those hateful green sectors into the circle on the bottom that says "Drag and drop files here to collect them"

Also, I typed sudo mdutil -i off.
Is that going to mean spotlight doesn't make another enormous index on by 500gb disk like a cancer?

Tetsujin
  • 115,663

3 Answers3

3

On OSX recent versions .Spotlight-V100 is xattr protected, meaning rm commands are inoperant, whatever privileges you own. This explains the "Operation not permitted" mentioned in the above thread.

To remove a .Spotlight-V100 folder, use the mdutil utility instead.

mdutil - manage the metadata stores used by Spotlight

we will disable (-d) and remove (-X) spotlight index for the Volume "NO NAME" :

sudo mdutil -d "/Volumes/NO NAME"
sudo mdutil -X "/Volumes/NO NAME"

Here the .Spotlight-V100 to remove is on the "NO NAME" volume. Adapt your command line accordingly.

Avoid any file operation before unmounting the "NO NAME" volume, or the folder will most probably come back...

Greenonline
  • 2,004
Leo
  • 31
2

EDIT: first, turn off indexing for all disks: sudo mdutil -a -i off. Do this step even though you did it previously, as the -a command will make sure it is disabled for all volumes. sudo su is unnessecary, so to eliminate variables, stick to the command exactly.

Then, delete the folder using the command sudo rm -r /System/Volumes/Data/.Spotlight-V100 If the folder re-develops, let it. 99% chance is that it will be reasonable this time.

After that, since this was certainly a bug, you can re-enable indexing if you'd like: sudo mdutil -a -i off (the file will hardly take up 5 gigabytes when it forms again correctly. If the issue happens again, repeat this without re-enabling indexing.

If you would like to check the size of the spotlight index, you can simply run the command sudo du -hs /System/Volumes/Data/.Spotlight-V100.

anonymousaga
  • 1,391
  • It is internal, but if I type cd /System/Volumes/Untitled after sudo su, it doesn't work. My internal hd is 500gb and this directory is 330gb. Amazing that it wasn't in terminal and it is inaccessible in finder. You have to buy daisy disk just to find it – Henrietta Martingale Feb 20 '22 at 18:21
  • @HenriettaMartingale It is innaccessible from finder to prevent abuse by people who do not fully understand macos. However, this is easy to bypass via terminal. As I stated, due to the structure of macos, the internal volume root is not located where it seems logical to. I have updated my answer with more details. And if you're wondering, daisydisk is not required to see this file. It is just an easy way to figure out that the file is bugging out. – anonymousaga Feb 21 '22 at 00:30
  • 1
    This was exactly the answer. 6 months I've been fighting this thing. Finally daisydisk and you were the answer. Thank you thank you. Odd, on finder its /System/Volumes/Untitled/.Spotlight-V100 and in your instruction, which was right, it's /System/Volumes/Data/.Spotlight-V100. That's funny. The implication is you have to be illogical to find things in the internal volume of macos – Henrietta Martingale Feb 21 '22 at 01:20
  • @HenriettaMartingale The way macos is organized is in a way that the /System/Volumes/Untitled is for macos itself, while /System/Volumes/Data contains your data. It was split this way in recent versions to make time machine restoring easier, making re-installs easier without losing data, and to prevent malware from accessing macos itself and rendering your entire system unusable (clean install required).yet, this does mean that the tinkerers have to find files in odd places. Finder has to jam 2 disks together into 1, while terminal shows how it is actually, so finder & terminal sometimes clash – anonymousaga Feb 21 '22 at 15:17
  • 1
    I'm still getting "Operation not permitted" – danorton Jul 13 '22 at 16:12
  • @danorton what command did you run & get this error? – anonymousaga Jul 13 '22 at 16:30
  • @anonymous sudo rm -r /System/Volumes/Data/.Spotlight-V100; Same error when directly referencing my drive. (Spotlight was definitely turned completely off, as my Spotlight Search no longer works at all, even for Applications.) – danorton Jul 14 '22 at 17:45
  • @anonymous Monterey 12.4,Darwin Kernel Version 21.5.0, M1 / arm64 – danorton Jul 14 '22 at 17:47
  • @danorton can you check if the folder even exists? It sounds like it doesn't. Run this command: cd /System/Volumes/Data && sudo ls -a | grep .Spotlight-V100. If it prints .Spotlight-V100 to the terminal, the folder exists. Otherwise, it doesn't, so your already good to go! Macos must have deleted it for you. – anonymousaga Jul 14 '22 at 18:43
  • @anonymous This command showed it: ls -alF – danorton Jul 14 '22 at 21:29
  • @anonymous The way that OS X works, when you attempt to remove anything with /bin/rm and it doesn’t exist, OS X does’t report “Operation not permitted”, instead it reports nothing at all (and doesn’t even return an error status). – danorton Jul 14 '22 at 21:40
  • @danorton i agree with that, but sometimes I have noticed some odd behavior with macos system files when they are gone. Just doing a safety check. I was going to ask you to try du -h, but im getting an operation issue as well. Maybe something with monterey 12.4? Chmod failed too. – anonymousaga Jul 15 '22 at 01:47
-2

Simple way: click sow hidden items

Shuaib
  • 1