Just to add
And Yes, have experienced this same issue on a M4 Mac Mini with Sequoia 15.1.1 and 15.2
Finding the offending file and application
If you've just seen a dialog that a volume can't be ejected, you can find the offending item in the Terminal application. Open the Terminal application and paste in the following:
sudo lsof | grep "CCC Backup"
Replace "CCC Backup" with the name of your own backup volume, then press the Return key. You will be prompted for your admin password; enter your password, then press the Return key again. The "list open files" utility will print a list of open files specific to that volume, and will include the name of the application that has the open file reference.
It's usually Spotlight
More often than not, some Spotlight process is retaining an open file on the backup volume and preventing it from being unmounted. If you find "mds" or "mds_stores" listed in the lsof output, you can disable Spotlight on your backup volume to prevent the interference. To disable Spotlight, open System Settings > Spotlight, scroll down and click "Search Privacy…", then drag the backup volume into the Privacy table. This only affects the selected volume, and it's reversible, you can remove it from that list should you decide that you want to re-enable indexing.
Once you have disabled Spotlight indexing, Spotlight should immediately cease indexing activity on that volume. The same underlying problem that might be causing Spotlight to fail to release an open file, however, (e.g. a stall) may also prevent Spotlight from ceasing the indexing activity. If you are still unable to unmount the volume after a) confirming that it was Spotlight with an open file, and b) adding the volume to the Spotlight Privacy table, you can either terminate the mds and mds_stores processes in the Activity Monitor application, or simply restart the system.
Sometimes Spotlight is so hung up, you can't add the volume to the Spotlight privacy list
We have recevied several reports from Sequoia users that the suggestion to add the backup volume to Spotlight's privacy table does not work; System Settings issues an error, "The item couldn’t be added or removed because of an unknown error". Clever users have attempted to use the mdutil command-line utility to disable Spotlight on the backup volume, but that also fails, "Error: unable to perform operation. (-400)". If you find yourself in this position and you're comfortable in the Terminal application, you can try the following steps to manually exclude a volume from Spotlight indexing:
- Quit the Terminal application if it is open
- Grant Full Disk Access to the Terminal application in System Settings > Privacy & Security > Full Disk Access
- Open the Terminal application and then open the Spotlight configuration file on your backup disk for editing:
- sudo pico "/Volumes/CCC Backup/.Spotlight-V100/VolumeConfiguration.plist"
- Add this block right after the "<dict>" line towards the top:
- <key>Exclusions</key>
- <array>
- <string>/</string>
- </array>
- Press Control+X, then type 'Y' to save and exit.
- Unmount the backup volume (forcefully, if necessary), then remount the volume. Spotlight indexing should now be disabled on that volume.