Jump to content

Eject Specific Drives/Volumes/Mounts

Recommended Posts

My first workflow! I saw a similar one that ejected all disks but wanted more fine grained control over which disks to eject.


When you type the keyword 'eject' it shows a list of the ejectable drives. Simply press enter or click on one to eject the drive. A notification should pop up in the notification center if the drive has been ejected.


Some stats about the drives are shown such as protocol, partition type, and size. Icons are also changed per protocol. Workflow uses a python.






Let me know if you have any suggestions or find any bugs.



Link to comment
  • 4 weeks later...
  • 2 months later...

I rather like this workflow.

One suggestion is to add 'Mount' and 'Unmount' to the mix merhaps with a modifier of CMD or OPT


Thing is, I have a 2.5" drive in a USB 2 Enclosure under my desk. I never disconnect it and it's always powered. So, using this or the built in Alfred 'eject' will not just unmount(eject) a single partition on my Drive (which has 3 partitions), it always ejects the entire drive.


Also, with my other two partitions, I sometimes like to unmount one so it is not showing in Finder, but after a week or so, I may want to mount it for whatever purpose. SO, modifying your workflow to show mountable volumes would also be very handy. I currently have a workflow to simply mount a volume once I type in the name of it, but showing a list in Alfred, hitting CMD and selecting the unmounted volume would be ideal.


Idea for this: Show mounted volumes (the icons) as you do now, but if a volume is not mounted, perhaps the icon could be at 50%, like it is in Disk Utility.


I would personally like to modify this workflow to suit my personal needs, but I am clueless with python. I also do not want to step on your toes because you have started this awesome workflow and it would appear that you could add these features if you deem them necessary.

Link to comment
  • 6 months later...
  • 5 months later...
  • 1 year later...
  • 10 months later...
  • 1 month later...

I haven't checked the new version you published, but the previous one requires a small change as of macOS Sierra.


diskutil info no longer refers to the size using the word 'size', but using the word 'space'. 


Therefore, the line "volume_size = re.search('Total Size:\s+(\S+\s\w+)', extra_info)" needs to be changed to "volume_size = re.search('Total Space:\s+(\S+\s\w+)', extra_info)"

Link to comment
  • 1 month later...
  • 1 year later...
  • 8 months later...
  • 9 months later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...