Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Unable to eject Samsung T7 external drive from my MacBook Pro

I purchased a Samsung T7 external drive. The drive wont eject from my Macbook Pro 2019. Reached out to Samsung and they suggested to reach out to Apple. Any thoughts why the drive won't eject?


[Re-Titled By Moderator]

MacBook Pro 16″, macOS 15.1

Posted on Nov 20, 2024 7:54 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 20, 2024 6:31 PM

Ok, let's try something a bit simplier.


I would like for you to enter the following command in the Terminal app:

  • lsof | grep /Volumes/YourDriveName


Replace YourDriveName with the name of your external drive as it appears in Finder under Locations. This command searches for any open files or processes accessing files on that drive.


Review the output. It will show a list of processes, including the process ID (PID), the command name, and the file or resource being accessed.


You can now try "killing" a process to see which one is keeping you from ejecting the drive.


The command for that is: kill -9 PID


Replace PID with the process ID of the process accessing the drive.


Lastly, if you find the process holding the drive is Spotlight indexing, you may want to temporarily disable Spotlight for that drive instead of killing processes: sudo mdutil -i off /Volumes/YourDriveName

16 replies
Question marked as Top-ranking reply

Nov 20, 2024 6:31 PM in response to alexchicago

Ok, let's try something a bit simplier.


I would like for you to enter the following command in the Terminal app:

  • lsof | grep /Volumes/YourDriveName


Replace YourDriveName with the name of your external drive as it appears in Finder under Locations. This command searches for any open files or processes accessing files on that drive.


Review the output. It will show a list of processes, including the process ID (PID), the command name, and the file or resource being accessed.


You can now try "killing" a process to see which one is keeping you from ejecting the drive.


The command for that is: kill -9 PID


Replace PID with the process ID of the process accessing the drive.


Lastly, if you find the process holding the drive is Spotlight indexing, you may want to temporarily disable Spotlight for that drive instead of killing processes: sudo mdutil -i off /Volumes/YourDriveName

Nov 30, 2024 9:19 PM in response to Electricmango

I talked with the ChatGPT Terminal helper, and made this script, which hopefully works.

  1. Open the shortcuts app and choose "Run Shell Script"
  2. Paste this code in and replace "MyDrive" with your SSD's actual name.

This should search for the PID on the drive, find them, disable them, then automatically attempt to eject the drive all in one button.



DRIVE="/Volumes/MyDrive"


# Find PIDs locking the drive

PIDS=$(lsof | grep "$DRIVE" | awk '{print $2}' | sort -u)


# Kill each PID

if [ -n "$PIDS" ]; then

echo "Killing processes: $PIDS"

echo "$PIDS" | xargs -I{} kill -9 {}

else

echo "No processes are locking the drive."

fi


# Attempt to eject the drive

diskutil eject "$DRIVE"


# Check if the eject was successful

if [ $? -eq 0 ]; then

echo "Drive ejected successfully."

else

# If the eject fails, prompt the user to force eject

osascript -e 'display dialog "Failed to eject the drive. Would you like to force eject?" buttons {"Cancel", "Force Eject"} default button "Force Eject"' > /dev/null

RESPONSE=$?


if [ $RESPONSE -eq 1 ]; then

echo "Force ejecting the drive..."

diskutil unmountDisk force "$DRIVE"

else

echo "User chose not to force eject."

fi

fi

Nov 20, 2024 12:53 PM in response to Tesserax

Hello! Let me give you all the details...


I have tried a few ways to eject it:

1. Simply right clicking on the external drive desktop icon and choosing "eject". (Does not work)

2. Dragging the external drive desktop icon into the trash. (Does not work either)

3. Going into disk utility and choosing "unmount" for the external drive. (Does not work either)


Not sure if there is another way to eject the external hard drive, I open to suggestions. The only thing that seems to work is to turn the Macbook Pro off and then eject the hard drive safely. I always get the same old message that the external drive cannot be ejected because it is used by an application, although no application is ever running when I try to eject the external drive.


To answer the second part of your question: It has worked fine before. I also assumed that maybe it is due to updating to Sequoia. I am currently on macOS Sequoia 15.1.1.


I contacted Samsung and I was told to contact Apple to resolve this, as they couldn't.


Btw there are multiple threads online of hundreds of people having the same issue. No answer to be found yet. If you can help I would greatly appreciate it :)

Nov 30, 2024 9:10 PM in response to Electricmango

Ah ok, I used the new ChatGPT Terminal feature and it helped me out. I used the command

kill -9 47924

And it quit the process running the photos library in the background and let me eject the drive. I wonder if the PID changes every login, so if I wouldn't be able to make a shortcut script of it. It's great to have found a solution, but I wish Apple would fix this.

Dec 2, 2024 2:58 PM in response to alexchicago

Ah, ok, I think I found a fix, that allows my T7 to eject without being held hostage by the Photos library stored on the SSD. (This should work for all processes that refuse to quit though)

I made an automated shortcut that I pinned to my top bar. It searches the SSD for proccesses running, extracts the PID's, quits them, then attempts to eject the drive safely. It's worked effortless for me. All thanks to @Tesserax and the ChatGPT "Working with Terminal" preview that popped up for me yesterday, and has since disappeared.


Open the code in this shortcut, and change the name of the drive to the name of your drive and it should work perfectly. (To find your drive name, just drag and drop your SSD into terminal and it should tell you the name of it. Hope this helps!

https://www.icloud.com/shortcuts/e801d9d04fd3460db68cbcb9c4cd63a8

Nov 20, 2024 1:54 PM in response to Tesserax

I appreciate the help. For earlier macOS releases and up to Sequoia 15.0 I believed it worked fine (meaning I could eject it without having to shut down the computer).


I tried the Activity Monitor app, looking at the Disks tab, but it seems like thousands of processes/apps are trying to access the drive (if I am reading this correctly) and the numbers fluctuate back and froth.


Not sure where to go from here...


*See image attached (not sure if this helps).


Nov 20, 2024 2:00 PM in response to Tesserax

I appreciate the help. For earlier macOS releases and up to Sequoia 15.0 I believed it worked fine (meaning I could eject it without having to shut down the computer).


I tried the Activity Monitor app, looking at the Disks tab, but it seems like thousands of processes/apps are trying to access the drive (if I am reading this correctly) and the numbers fluctuate back and froth.


Not sure where to go from here...


*See image attached (not sure if this helps).


Nov 30, 2024 8:57 PM in response to alexchicago

@Tesserax

Thanks for all the troubleshooting. I've entered the terminal code you suggested to view the processes running on the T7. For me, it comes up with 4 different processes all linked to my Photos library I have stored on my SSD. I kind of figured this was what was causing the issue when force quitting ".photo" related items allowed me to eject, but now I am unable to. Do you know which of the items in terminal is the PID? and if I kill all 4 PID's will it damage the Photos library? Is it just a temporary fix that needs to manually be done every single time to eject drives?

Nov 20, 2024 1:13 PM in response to alexchicago

When it was working, I'm assuming that was with an earlier macOS release, like Sonoma or Ventura ... correct? ... or was that with Sequoia 15.0, 15.0.1, or 15.1?


Regardless, it is certainly possible the update to 15.1.1 introduced this issue.


As far as other methods to eject a disk ... no, you pretty much exhausted all of them that I'm aware of.


From my experience, this issue often arises when background processes or applications are accessing the drive, even if they're not immediately visible. The key, in this case, it to see what those might be. This is where the Activity Monitor app should come in handy. I suggest using it with the Disks tab open to see what processes/apps are trying to access this drive.


If you find any that are, try stopping them one at a time, checking to see if you can eject the drive after each one.

Nov 30, 2024 8:46 PM in response to alexchicago

I have the same issue; no idea why Apple has not fixed this by now, as it's been an issue with the last 2 or 3 OS versions. Before you could open activity monitor and quit anything under the search "photo" + quitting the photos app, and usually this would almost always let you eject after a few tries. Now in Sequoia, there is no good work around. The only one I found to work is if I do the force quitting, then logout and log back in. This works for me, but it's extremely annoying needing to open all your application windows from scratch, and to manually restore the previous browser session... Uhgggg


(Running a 2022 16" M2 Ultra Macbook Pro)

Unable to eject Samsung T7 external drive from my MacBook Pro

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.