Can I delete .Spotlight directory?

Hello all,


I found that the directory .Spotlight (under root directory of MAC OS) has huge size, more than 10GB.

Since my MACbook Air suffered low disc space, can I delete some files or subdirectory under this .Spotlight ?

I thought it looks like an indexing system. It maight be also copying files/documents from other directories into different formats, I don't know.

If there are some MAC experts here, please advice, I want to free my disc, it fastly run out space when I use the computer after I upgrade to SIerra.

Thanks.

MacBook Air, macOS Sierra (10.12.5)

Posted on Jun 6, 2017 12:36 PM

Reply
5 replies

Jun 6, 2017 12:59 PM in response to sagustian

No they are not safe to remove, look elsewhere to recover space.


Those are system files & were created when the Mac was first setup. The actual contents of those folders may have newer files. The files are the Spotlight index, they allow you to find files, email, photos, music etc.


Please do no attempt to delete those items in Finder - it can easily fail & leave you in a mess trying to remove them or trying to put them back.

If you want to delete the index do it correctly…


  • System Preferences > Spotlight
  • Open the Privacy tab.
  • Add your system disk to the list of items that WILL NOT BE INDEXED.
  • Agree to the warning when adding a system disk.


Spotlight will delete all the relevant files, you will no longer be able to use spotlight to find files by the file content but filename searches should still work. Remove the disk from the privacy list to reindex it.


I suggest you avoid deleting any files that you do not know you need. System files are important and hidden files ones are often hidden to prevent users from seeing & deleting them.


Use OmniDiskSweeper to find large files in your home folder - that is the best place to reduce data storage - otherwise the OS can become unstable or may simply rebuild the files that you try to remove.

http://omnigroup.com/more


Post images of that app if you are uncertain of the files and folders you find, some system files cannot be deleted by users anyway but it is best not to try if you are unsure.

Jun 6, 2017 12:44 PM in response to sagustian

Here are some examples of huge files:

rw------- 1 root wheel 55M Jun 7 04:39 .store.db

-rw------- 1 root wheel 256K Jun 7 04:24 0.directoryStoreFile

-rw------- 1 root wheel 256K Jun 1 15:08 0.directoryStoreFile.shadow

-rw------- 1 root wheel 628M Dec 4 2016 0.indexArrays

-rw------- 1 root wheel 197M Dec 4 2016 0.indexCompactDirectory

-rw------- 1 root wheel 8.7M Dec 4 2016 0.indexDirectory

-rw------- 1 root wheel 437K Jun 7 04:39 0.indexGroups

-rw------- 1 root wheel 4.0K Jun 7 04:34 0.indexHead

-rw------- 1 root wheel 4.3M Jan 17 22:25 0.indexIds

-rw------- 1 root wheel 6.8G Dec 4 2016 0.indexPositions

-rw------- 1 root wheel 352M Dec 4 2016 0.indexPostings

-rw------- 1 root wheel 640B Dec 4 2016 0.indexUpdates

-rw------- 1 root wheel 437K Jun 7 04:29 0.shadowIndexGroups

-rw------- 1 root wheel 4.0K Jun 7 04:29 0.shadowIndexHead

-rw------- 1 root wheel 4.0M Jun 7 04:24 1.directoryStoreFile

-rw------- 1 root wheel 2.3M Jun 1 15:01 1.directoryStoreFile.shadow

-rw------- 1 root wheel 180M May 22 06:52 1.indexArrays

-rw------- 1 root wheel 46M May 22 06:52 1.indexCompactDirectory

-rw------- 1 root wheel 4.4M May 22 06:52 1.indexDirectory

-rw------- 1 root wheel 514K Jun 7 04:39 1.indexGroups

-rw------- 1 root wheel 4.0K Jun 7 04:34 1.indexHead

-rw------- 1 root wheel 5.0M May 22 06:52 1.indexIds

-rw------- 1 root wheel 967M May 22 06:52 1.indexPositions

-rw------- 1 root wheel 102M May 22 06:52 1.indexPostings

-rw------- 1 root wheel 194B May 22 06:52 1.indexUpdates

-rw------- 1 root wheel 514K Jun 7 04:29 1.shadowIndexGroups

-rw------- 1 root wheel 4.0K Jun 7 04:29 1.shadowIndexHead

We can see some similar files with different version or creating date.

e.g. :

-rw------- 1 root wheel 628M Dec 4 2016 0.indexArrays

-rw------- 1 root wheel 180M May 22 06:52 1.indexArrays

-rw------- 1 root wheel 18M May 22 06:47 2.indexArrays

-rw------- 1 root wheel 4.0M Jun 7 04:24 live.10.indexArrays

-rw------- 1 root wheel 2.1M Jun 1 15:34 live.11.indexArrays

-rw------- 1 root wheel 4.0M Jun 7 04:24 live.12.indexArrays

And this is the most disc consuming file:

-rw------- 1 root wheel 6.8G Dec 4 2016 0.indexPositions

Since the date of those files are old, can I just remove them?

thanks

Jun 6, 2017 3:05 PM in response to Drew Reece

I delete many files from directory ./cleverfiles. It contains backup files which are redundant.

When I move/rename the file by cut the text after extension part in each filename, I can read the file, e.g. jpg, mov, etc.

For example, this is the file in ./cleverfiles: 20160917_125547.jpg.7074924e-c859-4813-b3af-3749b01151dc

I renamed to 20160917_125547.jpg. I can see what picture it is with Preview app. No matter.

This was a state when I deleted some files:

sh-3.2# df -h

Filesystem Size Used Avail Capacity iused ifree %iused Mounted on

/dev/disk1 112Gi 108Gi 3.7Gi 97% 1685010 4293282269 0% /


I checked again the contents of that directory.

sh-3.2# du -h .cleverfiles/hlink.ref/

234M .cleverfiles/hlink.ref//592fd2cfTe820a23a-5cba-4254-84c8-cb0d3482acd7

340M .cleverfiles/hlink.ref//592fd42dTeb23fc9b-3656-4393-887d-1f2855707e0d

162M .cleverfiles/hlink.ref//593003d2Tbaae6be9-47c7-4fcc-a5e5-b901dd6e5d7c

9.2G .cleverfiles/hlink.ref/

Then I found many huge files like Siearra installation file (more than 3GB), other dmg and zip files (all in backup format like the jpg as in the above example), and many others. Since I have the original files, I just delete them all.

This is the last status of my disc space:

sh-3.2# df -h

Filesystem Size Used Avail Capacity iused ifree %iused Mounted on

/dev/disk1 112Gi 100Gi 12Gi 90% 1628062 4293339217 0% /

Now my MAC can breath better.

I don't know yet if this action will affect my MAC performance on accessing those files.

I think it is OK since the date of those files are old, and the contents are redundant with the originals.

Jun 6, 2017 4:21 PM in response to sagustian

I do not know what those files were but you should ask for help from cleverfiles - Free Mac Data Recovery Software. Recover Files. Disk Drill


I suspect you have run data recovery or have enabled an option to make Drill Disk to save files on your disk. You may be deleting files that you asked to be backed up. Those folders may reappear if you still have that app or feature enabled.

It may be the 'Guaranteed Recovery' feature that appears to duplicate files to help 'data recovery'.


P.S. 12GB is still not enough free space - you should free up 20-30GB to allow the Mac to run well. The OS will write a lot of temporary and cache files during normal use, so lots of free space helps performance, especially if you have a spinning hard disk.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can I delete .Spotlight directory?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.