I have a large SSD drive connected to my iMac as my main working drive, and macOS is still on the internal drive. Can remove the ability to accidentally eject it from Finder somehow?

enter image description here

I would just like to make ejecting the drive something a bit harder, so there's no change an errant mouse-click could do so!


1 Answer 1


Open a Terminal application window and enter the following command.

cd /Volumes/Data

This changes the current working directory to /Volumes/Data, which is the root folder of the external drive. If you try to eject the drive, you should get a message stating the drive is in use by the Terminal application.

I suppose one could instead enter the commands below which would run processes in the background. Afterwards, you could quit the Terminal application while still protecting the drive from being ejected.

cd /Volumes/Data
bash -c 'while true; do sleep 3600; done &'

User Solomon Ucko posted the following question as a comment.

To make this permanent, would there be some way to set this as a startup script?

This subject is well covered elsewhere on Stack Exchange. Some examples are given below.

  • 5
    This will not eliminate the possibility of a physical disconnection by cable failure, or a misplaced cat's paw. (The cat's paw happened to me a few years ago when a kitten decided it would be fun to run quickly behind my iMac chasing a reflection.)
    – IconDaemon
    Commented Feb 1, 2023 at 12:15
  • 4
    I don't think we really need a comment that running a terminal script doesn't prevent someone physically removing a cable... not unless Apple start adding lockable clamps to their ports!
    – Mr. Boy
    Commented Feb 1, 2023 at 15:28
  • 3
    Perhaps what we need is a comment advising the use of superglue for making the external drive non-ejectable. But not welding. ? Commented Feb 1, 2023 at 15:49
  • 2
    To make this permanent, would there be some way to set this as a startup script? Commented Feb 1, 2023 at 20:11
  • 2
    @SolomonUcko: I updated my answer. Commented Feb 1, 2023 at 21:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .