
This took way too many hours of my life I will never get back.
Launchbar eject all volumes mac#
I upgraded my late 2014 Mac Mini withĪ shiny new 1TB SSD. You will see the same starting piece which nets the list of drives/volumes and these are then passed via xargs to the diskutil eject command which does the work.Today I wanted to move existing APFS-resident macOS Catalina installation to a new disk. Yes, I used a CD emoji, because that's the best I could do at a glance.ĭf | egrep '^/dev.+\s/Volumes.+' | sed -E 's|.+/(.+)|\1|' | xargs -n 1 diskutil eject The rest of the command is just manipulating it for display - put it on one line, add spaces, and an emoji.

If it lists what you expect, then this should be a safe widget for you. You can run this command in Terminal on your Mac and see what pops out.

The intended use case is when undocking your Mac laptop from a Thunderbolt hub/display and you need to eject all of the drives first.

I have, however, provided a run-down of my commands below if you want to explore the results before committing to use the widget. There may be factors I have not taken care of, so use at your own risk! A very simple TouchBar widget I whipped up to both see and eject removable drives.ĭisclaimer: I worked this out from various online posts regarding the commands used, and by testing it out on my Mac.
