Jump to content

Remounting ejected drives


Recommended Posts

Posted

I like the eject (all) feature in Alfred (I am not sure if it is part of Alfred or a workflow; has been using it for ages now.)

 

I was wondering if there is a workflow to remount the unmounted (ejected) derived.

I already found some kind of apple script: , also similar here https://apple.stackexchange.com/questions/125854/remount-drive-without-physically-disconnecting

 

 

 

Quote

set diskName to "YourDiskNameHere"
tell application "Finder"
 if disk diskName exists then
  eject disk diskName
 else
  tell current application
   set deviceLine to (do shell script "diskutil list | grep \"" & diskName & "\" | awk '{ print $NF }' }'")
   if deviceLine = "" then
    display dialog "The disk \"" & diskName & "\" cannot be found." buttons {"OK"} default button 1 with title "Error" with icon caution
   end if
   set foundDisks to paragraphs of deviceLine
   repeat with i from 1 to number of items in foundDisks
    set this_item to item i of foundDisks
    if this_item contains "disk" then
     do shell script "diskutil mountDisk /dev/" & this_item
    end if
   end repeat
  end tell
 end if
end tell

 

 

Can you guys make a nice workflow to remount unmounted drives?

It will take me long time to make it real since I have no experience in scripts.

 

Posted
On 25/11/2017 at 10:46 PM, Dellu said:

I was wondering if there is a workflow to remount the unmounted (ejected) derived.

 

There is a difference between unmounting and ejecting. You can see it by opening the Disk Utility app (/Applications/Utilities/Disk Utility.app) and unmounting/mounting and ejecting drives. You’ll notice that after you unmount, it’ll remain there but greyed out, ready to be mounted again. However, if you eject the drive disappears completely.


So (as far as I know) this is not possible. If the drive was ejected (what Alfred does), you need to unplug it and plug it back again.

Posted (edited)
1 hour ago, vitor said:

So (as far as I know) this is not possible.

 

For external drives, you’re correct. They need to be disconnected and re-connected to mount them again.

 

If the drive is internal, you can remount it after ejecting it with Alfred. I regularly “eject” my internal back-up drives with Alfred, and SuperDuper! has no problem re-mounting then again. 

 

So it may just be a question of which bus the drive is connected to.

Edited by deanishe
Posted
11 hours ago, vitor said:

 

There is a difference between unmounting and ejecting. You can see it by opening the Disk Utility app (/Applications/Utilities/Disk Utility.app) and unmounting/mounting and ejecting drives. You’ll notice that after you unmount, it’ll remain there but greyed out, ready to be mounted again. However, if you eject the drive disappears completely.


So (as far as I know) this is not possible. If the drive was ejected (what Alfred does), you need to unplug it and plug it back again.

Thanks for explaining the difference between unmounting and ejecting.

How about making the workflow for unmounted drives?

 

Even a more complete workflow to both mount and unmount drives.

 

When the user writes unmount on Alfrid she will have a list of all the mounted drives to unmount.

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