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.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

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 Account.