SOLVED: MacOS error "Disk not ejected properly" (large external SSD)

Installing, configuring, maintaining and designing operating systems
Santeri
Posts: 330
Joined: 2017-7-5 09:58

Unread post by Santeri » 2024-8-1 13:53

MacOS versions Ventura (13) and Sonoma (14) are erratically disconnecting external SSD hard drives. How to detect the issue, what is wrong and how to fix the issue?

How to detect the issue?

External SSD disk drives may be written files without issues, but when you try to read files, especially larger ones, or copy them from the disk, the process in hanging showing the following dialog box with no progress:
Preparing to copy
FIX: MacOS freeze Preparing to copy dialog After some time, the external drive will disconnect showing the following error message:
Disk not ejected properly
FIX: MacOS Disk not ejected properly error The process fails when your disk suddenly disappears
The operation can't be completed because the device disappeared
FIX: MacOS error The operation can't be completed because the device disappeared The same happened when I just left the disk connected to the MacBook for some 15 minutes, so it didn't actually even require any action.

What is wrong?

I have tested the issue and found a solution. My problems started when upgraded my 1 TB external SSD drive to 4 TB. At first I didn't notice anything. Storing files to disk and taking backups worked. Then I needed to get back some files from the disk and that's when the problems started. At first I though the drive was breaking up or the file system got corrupt. I took the disk to service to discover it had 99% health left and no hardware issues. Then I tested the drive with various MacBooks and iMacs. I was suspecting that there was not enough power in the USB-C bus for the drive, or the issue was in the operating system version I was currently running. The same issue manifested in all the test computers. That led me to suspect that perhaps the issue was in MacOS itself and related to the high speed SSD drives. To test my hypothesis, I cloned the external SSD disk to an external hard disk. All my data was perfectly fine, accessible and working on the slow disk.

How to fix the issue?

If you are having similar issues with your external hard drive, simply clone the non-functional disk to an old, slow hard disk. To clone your disk, you need to buy a new external hard disk that is the same size as your current, non-functional drive. This is important. Otherwise you have to resize your current disk which is a tad more complicated.

Here are the steps to take:
  1. Open terminal to use command line
  2. List the disks to find the correct ones for cloning typing the following command

    Code: Select all

    diskutil list
  3. Type command

    Code: Select all

    sudo dd if=/dev/diskXXX of=/dev/diskXXX bs=1m status=progress
You need to find from the disk list the correct source and destination disks, and replace XXX in the command above with correct disk numbers. Put the source disk number to IF parameter and destination disk number to OF parameter. Please note, that this process can take days. Cloning my 4 TB disk took almost 3 full days. If cloning is interrupted for some reason, you can start it again. Just make sure to check the correct disk numbers because they can change when your computer restarts, and be very careful to select the right disks as the changes to destination disk are irreversible. Before cloning, make sure the disks are not mounted. You can unmount drives from finder or using the built-in diskutil app.

When cloning is ready, disconnect the source drive and mount the destination drive. You should not connect the drives at the same time as they are identical and will confuse the OS, especially if you have there timemachine backups. Luckily dd is using raw disk data while the issue appears to be on the logical layer.

Final words

Unfortunately MacOS is not open source so I have no way to check the code, fix it and provide a working solution for everyone. Apple does not seem to have any interest in fixing the issue judging from the countless reports and posts I have read. I have not shared this solution with Apple or discussed it on Apple Support Community forum as I don't like to deal with the stupid cult and clueless idiots protecting Apple by hiding issues and blaming users.
Apple is a cult Do not get an SSD disk If you consider buying an external hard disk for your Mac. They are not work properly if at all with current MacOS versions.

Happy hacking,

Santeri

PS. Don't bother trying solutions to disconnecting drives proposed in various web sites, or installing some shady apps for a fix. They do not work. This is the only working solution until Apple does their job and fixes the bug they have created.