Tuesday, March 11, 2025

Process Behind Spotlight

This topic is related to my previous blog on Time Machine Backup Issues

While working on my Mac’s Time Machine backup, I believe I disabled the Spotlight process. Spotlight was indexing my external Time Machine backup drive, which prevented me from resetting and cleaning up the drive.

After resolving my Time Machine backup issue, I realized that Spotlight was no longer working. I could no longer launch applications quickly using Command + Space. It was quite frustrating.

Checking Spotlight Settings

I went to System Settings -> Spotlight, but all the Spotlight settings appeared to be correct. Unfortunately, I couldn’t find an option there to restart Spotlight.

Restarting the Spotlight Process

Eventually, I figured out how to restart the process—the same process I had modified while troubleshooting my Time Machine backup issue. Here’s how you can do it:

Steps to Restart Spotlight

  1. Open Terminal from
    Applications->Utilities->Terminal
    . (Since Spotlight wasn’t working, I had to open it manually.)
  2. Run the following command:
    sudo mdutil -a -i on
    

The mdutil tool is used to manage Spotlight’s indexing process. I realized that I had previously disabled this service, and while I had restored my Time Machine backup, I had not re-enabled Spotlight indexing. That’s why Spotlight was not working.

After running this command, Spotlight started working within minutes. I could once again use Command + Space to launch my frequently used applications, such as Preview, Terminal, MacVim, and Safari.

Spotlight’s Background Process: mds_store

One interesting note about Spotlight’s indexing process is that it is managed by a background process called mds_store. However, when I checked Activity Monitor, I couldn’t find a process with that exact name. It’s possible that the process name has changed, but in any case, the steps above successfully restored Spotlight’s functionality.

If you have disabled this process, you will need to manually enable it using the steps above.

References

Thursday, March 6, 2025

Time Machine Backup Issue

Recently, I discovered that my Time Machine backup to an external hard drive was no longer working. I kept receiving failure messages, but they did not clearly explain the reason for the failure. Eventually, I realized that the available space on the drive was insufficient.

The quickest way to resolve this issue was to erase all backup data on the drive and start a fresh backup from scratch.

Erasing Time Machine Data

The best way to erase Time Machine data from the drive is by using the Disk Utility tool, which wipes out all data and reformats the drive as needed. However, when I attempted to erase the drive, I encountered another failure message. The system reported that the process "mds_store" was preventing the operation (holding the drive).

Following advice from a Google search, I tried terminating the process via Terminal. However, even after killing the process, I encountered the same failure message when attempting to erase the drive again.

Finally, I found a solution! I restarted my Mac in Safe Mode by holding the Shift key during startup. Since Safe Mode runs with minimal processes, I was able to successfully erase the data on the drive by using Disk Utility.

Adding the Drive Back to Time Machine

Once I had the drive ready, another issue appeared—the drive did not show up in the list of available backup drives, preventing me from adding it back to Time Machine.

I recalled receiving a warning message about "Forgetting this drive as a Time Machine backup" when I initially removed the external drive from the Time Machine settings. It seemed that macOS had stored a hidden setting to prevent this drive from being used as a Time Machine backup again. Unfortunately, I wasn’t sure where to change this setting.

Fortunately, I noticed that another partitioned drive appeared as an available Time Machine option. This drive contained important data, such as my picture libraries and historical records. When I selected this drive as a Time Machine backup, the backup process started immediately. However, I did not want to use this drive for backups, so I stopped the process.

One thing I observed was that a Backups.backupdb directory was created on this data drive. I decided to copy this directory to my intended backup drive. To my surprise, after doing this, the drive finally appeared in the Time Machine settings as an available backup option!

Time Machine Permissions

Another interesting discovery was related to permissions on my Time Machine drive.

When I erased and reformatted the drive, the permission settings were as shown in the following picture:

These permissions were the same as those of my data drive. However, when the drive was set up as a Time Machine backup, the permissions changed to the following:

I noticed that I could no longer modify these permissions or add an admin user. If I wanted to copy or erase any data on the drive, I had to enter my admin passwordeach time.

Conclusion

After a long struggle, I finally managed to get my Time Machine backup working again!