When Mac ejects the mobile hard disk, it shows "the disk cannot be ejected because one or more programs are using it" solution

1. Restart the Finder

Hold down the Option key, right-click the Finder icon in the dock at the bottom, and select Restart. At this time, the Finder app will restart, and then try to launch it.

Or: Click the Apple icon in the upper left corner, select "Force Quit", select the Finder, and you can also restart the Finder.

But this method is often ineffective, because it is often the Finder app that occupies the mobile disk and cannot be launched, so after restarting, the Finder will still occupy the mobile disk.

2. Restart the computer

This method can be described as the most simple and crude method. Turn off the computer, pull out the mobile hard disk, and then turn it on.

Another method is recommended by Apple's official website (see Apple's official solution for details ). The method is to log out of the Apple ID, and log in again after launching the Finder.

The disadvantages of these two methods are also obvious. It takes a long time, and whether it is restarting or re-logging in, it will have a great impact on the work at hand. I personally don't like and have never used these two methods.

3. Terminal command line method

This method can be said to be tried and tested!

Open the terminal app (you can directly command + space to bring up the search, and then search for "terminal" or "terminal"), open the terminal:

terminal interface
Enter the following code, which is used to view all disks on the current Mac:

df -lh

Note that there is a space between f and -.
After viewing, you will get a list of all disks on the current Mac:

disk list

Under normal circumstances, the name of your own mobile disk will appear here, in the last one (I don’t have a mobile hard disk inserted here, so the pictures are all the disk names that come with Mac). In addition, you can see that each disk corresponds to a code (such as disk1s2).

Then execute the following code to push out the removable disk:

diskutil unmount /dev/diskAsB

Note: 1) There is a space unmountbetween and /dev; 2) The number corresponding to A and B is df -lhthe number corresponding to the mobile disk in the command. For example, df -lhafter the command is executed, the number corresponding to the mobile disk is , then write disk2s2here .diskAsBdisk2s2

Because the disk is occupied by a process, it cannot be launched, so the terminal will prompt: [磁盘代号] failed to unmount: dissented by PID XXXX.

At this time, open the Activity Monitor app again, under the CPU menu , find the corresponding PID XXXX in the PID column, click the cross in the upper left corner, and select Forced Quit .

4. df -lhThe solution when the name of the removable disk is not displayed

df -lhSometimes the name of the removable disk is not included in the list of disks entered in the terminal . At this point, you can change df -lh df -hto see the name of the removable disk. Subsequent operations are the same as method 3.

Guess you like

Origin blog.csdn.net/weixin_58399148/article/details/128503893