Abstract
- Do not attempt to eject a drive while you’ve obtained recordsdata open or are copying giant quantities of information to or from it.
- If nothing appears to be utilizing the drive, use Terminal to spotlight any background providers which are guilty. Take away the drive from Highlight indexing to keep away from being unable to eject it.
- Restore the drive utilizing Disk Utility to make sure there are not any {hardware} issues.
Ever tried to eject an exterior drive, just for macOS to let you know that it is nonetheless in use while you’re completely sure that it’s not? It is a widespread and annoying drawback, however is fixable. This is how I did it.
Use Terminal to See What’s Utilizing the Drive
The error message saying that your drive “wasn’t ejected as a result of a number of packages could also be utilizing it” will be complicated.
Usually, in case you’ve nonetheless obtained a file open, otherwise you’re copying knowledge to or from the disk, the message will let you know what app is concerned. Shut the file, look ahead to the duty to complete, and also you’re good to go.
However typically, there does not look like any app utilizing the drive, but even the “Attempt Once more” and “Power Eject” choices will not work. This possible signifies that there’s some background job nonetheless operating. The one strategy to discover out what it’s is thru a terminal command.
Open Terminal (press Command+Spacebar and kind “Terminal”) and kind within the following command, leaving an area on the finish.
sudo lsof
Then drag your drive icon into the Terminal window so as to add the total path to it, in order that it appears to be like like this:
sudo lsof /Volumes/[your drive]
Hit Enter, and kind in your password if prompted.
The ensuing output will record all of the apps which are utilizing the drive within the column labeled “Command.” When you acknowledge the offender, you may be capable to shut down the app or go into Activity Monitor and quit the relevant process. In my case, and what looks as if the commonest challenge, the method “mds” was accessing the disk’s contents.
“mds” stands for Metadata Server, and signifies that Highlight is indexing the drive’s recordsdata. To start with, you’ll be able to attempt to look ahead to it to complete, though in my expertise which may by no means occur. If it does not, you’ll be able to take away the drive from Highlight altogether.
Take away the Drive From Highlight Indexing
Spotlight is a Mac search tool you’ll be able to entry by urgent Command+Spacebar in your keyboard. Amongst different issues, it indexes all of the recordsdata and folders in your exterior drives so you’ll be able to simply entry them. However typically this could trigger issues. I had two flash drives and an exterior SSD that I could not eject, and Highlight was the explanation in all circumstances.
The answer is to take away the drive from Highlight indexing. The draw back to that is it means you will not be capable to search shortly for recordsdata in your exterior gadget. However, it does imply you can eject it correctly.
Go to System Settings > Highlight and scroll right down to click on the “Search Privateness” button. Drag your exterior drive into the window that opens and click on “Executed.” It will forestall Highlight from indexing the drive.
Now, you need to be capable to eject your drive as regular.
If you cannot drag the exterior disk into the search privateness window, it would imply that Highlight has already begun indexing it. If this occurs, sign off of your Mac, take away the drive, log again in, reattach the drive, after which strive once more. It ought to work this time and repair the issue.
Restore the Drive
The ultimate step is to repair your external drive, simply to make sure that there are not any {hardware} points. You must do that half final as a result of the restore course of entails ejecting the quantity, which it will not be capable to if you have not fastened it.
Open Highlight by urgent Command+Spacebar and begin typing “Disk Utility.” Choose it from the record when it pops up.
Below “Exterior” within the sidebar, choose the Quantity in your exterior drive (not the drive itself) and go to First Assist > Run. Disk Utility will eject and scan it, then restore it if needed.
It will additionally flag up any warnings that may very well be an indication of any {hardware} issues. When you see one thing right here, it is time to think about changing the drive so you aren’t getting hit by {hardware} failure sooner or later.
With all of the steps full, you need to now be capable to eject the disk with none issues. Repeat these steps for any subsequent drives which you can’t eject.
There are many generic ideas for eradicating drives that macOS cannot eject. These may embody force-quitting Finder, logging out of your person account, shutting the lid in your MacBook, and even simply yanking it out and dealing with “Disk Not Ejected Properly” warning.
Until you are writing to the drive on the time, your knowledge is unlikely to get corrupted. However it’s nonetheless preferable to repair the issue, and these steps ought to enable you to try this.