everyday mac tools

Files on an unplugged external drive: knowing what is where

· 5 min read

macOS forgets an external drive the moment you eject it. Spotlight searches only what is mounted, so the way to know what is on the drive in the drawer is to catalog it while it is plugged in: either a plain text listing you keep on the Mac, or a search app that remembers unplugged drives. Either takes a few minutes per drive and ends the ritual of plugging in three drives to find one file.

Why Spotlight cannot help once the cable is out

Spotlight keeps the index for an external drive on the drive itself, in a hidden folder at its top level. That is why a drive you have used before searches quickly the next time you plug it in, and it is also why there is nothing left to search once it is unplugged. The Mac holds no record of what was there.

Finder is no better. Recents shows files you opened, not files that exist, and a drive that is not mounted simply disappears from the sidebar.

Method one: a text listing you keep on the Mac

This needs nothing but Terminal and it produces a file that Spotlight itself will search for you.

  1. Plug in the drive and wait for it to appear on the Desktop or in the Finder sidebar.
  2. Make a folder for listings, for instance ~/Documents/Drive lists.
  3. Open Terminal and run, with your drive’s name in place of Archive 2019:
find "/Volumes/Archive 2019" -type f -not -name ".*" > ~/Documents/"Drive lists"/"Archive 2019.txt"
  1. Eject the drive when the command returns. Its prompt comes back when the listing is complete; a drive with hundreds of thousands of files takes a minute or two.

The result is one line per file, with the full path, in a plain text file. To find something later, open the listing and press Cmd-F, or search all the listings at once from Terminal:

grep -i "tax return" ~/Documents/"Drive lists"/*.txt

The better trick is that the listing is an ordinary text file in your Documents folder, so Spotlight indexes its contents. Type the filename you are looking for into Spotlight and the listing for the right drive appears as a result, which tells you which drive to fetch.

If you want sizes as well as names, add -size +100M to list only large files, or use ls -lR instead of find for a longer listing with sizes and dates. Terminal will ask for permission the first time it reads a removable volume; allow it.

Redo the listing whenever you add a lot to a drive. Putting the date in the filename, or just overwriting the old one, both work; what matters is that there is a listing at all.

Method two: a search app that remembers

Everywhere catalogs a drive while it is connected and keeps the entries when it is unplugged. Search for a file later and it shows up dimmed in the results, with the name of the drive to plug in. Once the drive is back, the entry is live again: Return opens it, Cmd-Return reveals it in Finder.

It is names and paths only. It cannot show you the contents of a file that is not present, and it does not search inside documents on any drive. What it removes is the guessing about which drive, which is the expensive part.

Name the drives so the catalog means something

A listing that says the file is on Untitled helps less than it should. Before cataloging, give each drive a name you can say out loud and will not reuse: click the drive on the Desktop, press Return, type the name. Write the same name on the drive with a label. Two drives both called Backup, one of which is a backup and one of which is not, is how files get lost for years.

Inside each drive, a few top-level folders by year or by project make a listing readable when you skim it, and make a search result meaningful when you see the path. Naming and folder habits that keep a Mac searchable covers the habits that carry over from the internal disk.

Drives that are a special case

Time Machine drives. Do not catalog these. Time Machine’s own browser (open Time Machine from the menu bar with the drive attached) is the right way in, and a find across a backup drive produces a listing many times the size of your Mac because every snapshot repeats every file.

Network shares. The same listing approach works with the share mounted, using its path under /Volumes. Spotlight generally does not index network volumes at all, so a listing is often the only search you will get.

Drives formatted for Windows. They catalog like any other. The one difference is that the Mac writes its index folder onto them, which a Windows machine then shows as clutter. If that bothers you, add the drive to the Spotlight privacy list in System Settings; the index stops, and so does searching that drive in Finder while it is plugged in. The find listing does not depend on the index, so cataloging still works.

Keep the listings where you will find them

A folder called Drive lists in Documents is enough. Do not keep the listings on the drives they describe, which defeats the purpose, and do not keep them only on a second external drive. If you back up the Mac, the listings come along.

Questions

Does Spotlight remember a drive between plug-ins? It remembers the index, because the index is stored on the drive, so searching is fast the moment it mounts. It does not remember anything while the drive is unplugged. There is no built-in way to search an absent drive.

Can I stop the Mac writing index files onto an external drive? Yes. Add the drive to the Spotlight privacy list (System Settings, then Spotlight, or Siri & Spotlight on Ventura and Sonoma) and indexing stops for that drive. Searching it in Finder then stops working too, which is the trade.

Is there a way to catalog from Finder rather than Terminal? Partly. Open the drive in list view, select everything, copy, and paste into a plain text document in TextEdit to get the names at that level. It does not descend into folders, so it is only useful for a drive with a flat structure. The find command covers every level.

What about a drive that has died? A listing made while it worked tells you what was lost, which matters for deciding whether a recovery service is worth the cost. That is the strongest argument for cataloging drives before you need to.