Is there a way to eject all the mounted hard drive volumes on an OS X computer from the command line? Applescript is OK if I can wrap that in a shell script.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Terminal try:
umount -a(All the filesystems described via getfsent(3) are unmounted.)umount -A(All the currently mounted filesystems except the root unmounted.)Fore more information see
man umount.Update:
Seems like you can also use this:
Didn’t test it, though. If it doesn’t work, try to use “unmount” instead of “unmountDisk”.
Oh, I also found the
ejectargument (instead ofunmountDisk). That might also be of interest.Update 2:
diskutil eject /dev/*seems what you are looking for (see comments).