I’m trying to run Disk Utility scan on an external drive. Disk Utility reports the drive is in use. lsof
reveals that it is.
% sudo lsof /Volumes/mydrive
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mds 1233 root 6r DIR 1,24 1020 2 /Volumes/mydrive
mds 1233 root 20r DIR 1,24 3468 2886959 /Volumes/mydrive/.Spotlight-V100/Store-V2/01234578-9012-3456-7890-123456789012
% sudo kill -9 1233
However, I cannot get to Disk Utility fast enough before mds
gets started again. Mac OS 14.1 on an M2 Mini.
How do I run a Disk Utility scan?
For reference:
% man mds | cat
MDS(8) System Manager's Manual MDS(8)
NAME
mds – metadata server
SYNOPSIS
mds
DESCRIPTION
mds is the metadata server. It serves all clients of the metadata APIs,
including Spotlight.
There are no configurations to mds, and users should not run mds
manually.
SEE ALSO
mdfind(1), mdls(1), mdutil(1)
Mac OS X January 19, 2006 Mac OS X
edit: I did check System Preferences, but I don’t see any way to disable Spotlight or the metadata server entirely. Unchecking options for what Spotlight should search doesn’t seem to change how Spotlight works, anyway. Web searches on how to disable Spotlight find results that basically are quite old, say it’s a really bad idea to do it, or both.