Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

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

I want to run a shell script to MOUNT all available external volumes

I found this for unmounting and it works fine:


osascript -e 'tell application "Finder" to eject (every disk whose ejectable is true)'


I don't know the syntax commands for the opposite action, mounting mountable disks. I tried substituting "eject" with "mount" and "ejectable" with "mountable" but no go.


Is it possible to script this?


Tx


The alternative is to buy the "Mountain" application and have done with it for $6.

MacBook Pro 14″, macOS 12.3

Posted on May 9, 2022 10:16 PM

Reply
3 replies

May 10, 2022 9:33 AM in response to jinet

I believe when you "eject" a drive, that you must physically re-connect the drive before macOS will see it. If you want to unmount & re-mount drives without physically re-connecting them, then you should use the "unmount" command instead.


As for scripting the re-mounting of unmounted volumes, I don't know how to do it with macOS.

I want to run a shell script to MOUNT all available external volumes

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