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.
views:
153answers:
1
+1
A:
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:
diskutil unmountDisk /dev/disk*
Didn't test it, though. If it doesn't work, try to use "unmount" instead of "unmountDisk".
Oh, I also found the eject
argument (instead of unmountDisk
). That might also be of interest.
Update 2:
diskutil eject /dev/*
seems what you are looking for (see comments).
BastiBense
2010-01-12 14:59:58
that's doesn't work for some reason
dan
2010-01-12 15:02:46
Why not? Any error messages? If so, please post them here. Also did you try the "-A" option (capital A).
BastiBense
2010-01-12 15:04:29
I tried umount -a, and a finder window opened, but that was it. I'll have to try the other commands tonight when I'm back where my external hard drives are.
dan
2010-01-12 16:31:11
`diskutils eject /path/to/volume` worked
dan
2010-01-13 02:39:42