Understanding Mac Os X Indexing Using “Mdutil -E -I off /”

Two questions about mdutil and indexing:

  • What is the -E option? It seems to me that it means something like "reindex" however the following bash command does not make sense to me mdutil -E -i off /.
  • Can you run mdutil on some arbitrary folder in your system and it will index recursively all subfolders, and nothing else on your system?

I have the general idea on mdutil but I'm just a little confused by the man mdutil explanation of -E.

1 Answer

As the man page for mdutil states; bold emphasis is mine:

The mdutil command is useful for managing the metadata stores for mounted volumes.

So when you ask:

Can you run mdutil on some arbitrary folder in your system and it will index recursively all subfolders, and nothing else on your system?

Nope, since mdutil is not a folder-based metadata storage tool, but rather a volume-based metadata storage tool.

Then you say:

What is the -E option? It seems to me that it means something like "reindex" however the following bash command does not make sense to me mdutil -E -i off /.

The -E option in the man page is described as:

This flag will cause each local store for the volumes indicated to be erased. The stores will be rebuilt if appropriate.

So the -E option simply erases a metadata store on a specified volume. And in the case of this example:

mdutil -E -i off /

That command will erase (via the -E option) the metadata store on the volume mounted at root (/) and then turn off the indexing status (via the -i off option) on the volume mounted at root (/) as well.

Your confusion might come from the fact that / doesn’t seem like an explicit volume name, but rather a path. But that / does indicate the root volume of the booted OS you are running that command on.

For example, let’s look at the output for ls -la /Volumes/ on an example Mac OS X system. It might look something like this:

drwxrwxrwt@  7 root  admin   238 Sep  3 19:48 .
drwxr-xr-x  29 root  wheel  1054 Sep  3 01:40 ..
-rw-r--r--@  1 jack  admin  6148 May 18 18:57 .DS_Store
lrwxr-xr-x   1 root  admin     1 Sep  3 10:17 Hard Drive -> /

Note how Hard Drive is not actually a “real” mounted volume as much as it is a symbolic link to the / mounted volume on the file system. The true mounted volume name is /.

So knowing that / and Hard Drive both point to the same mounted volume this command using the full /Volumes/ name:

mdutil -E -i off /Volumes/Hard\ Drive/

is effectively the same command as this on the same Mac OS X system:

mdutil -E -i off /
4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest