
Open Terminal and type the chosen command with the correct device name. When you’re checking a container, it’s best to unmount each of its volumes before unmounting the container itself.

MAC UNMOUNT DISK ERROR MAC OS
Use the script only with the drives that you never/link use at all in Mac OS - in my case, this applies to the Bootcamp drive. In Disk Utility (or Terminal) unmount the container or volume, by selecting it and clicking on the Unmount tool. Please note that unmounting an internal HDD screws up some links, for instance, if you had shared folders - they will not be shared after re-mounting the drive. Tell application "GrowlHelperApp" to notify with name "Disk unmounted" title "Disk unmounted" description "Disk “" & diskDev & "” with volume “" & myVolumeLabel & "” has been successfully unmounted." application name "Disk Mounter" icon of application "Disk Utility.app" Tell application "GrowlHelperApp" to notify with name "Disk mounted" title "Volume mounted" description "Disk “" & diskDev & "” with volume “" & myVolumeLabel & "” has been successfully mounted." application name "Disk Mounter" icon of application "Disk Utility.app"ĭo shell script "diskutil unmountDisk " & diskDev If this solution doesn’t work, try the next one. dev/diskx should be replaced with the correct disc number, such as /dev/disk1. Finally, type sudo diskutil unmountDisk force /dev/diskx on the command line. Set diskDev to do shell script "diskutil list | grep \"" & myVolumeLabel & "\" | grep -o 'disk*' "ĭo shell script "diskutil mountDisk " & diskDev You should now locate the disc that you want to unmount forcefully. Register as application "Disk Mounter" all notifications allNotificationsList default notifications allNotificationsList icon of application "Disk Utility.app" Ensure that the USB boot drive is attached to the device. Please use at your own risk!Ĭhange myVolumeLabel variable to the label of any volume on the drive you want to (un)mount. If you're struggling with the 'Couldn't Unmount Disk' error, the way to fix this is to boot the Mac system from another drive and then run Disk Utility on the disk.
MAC UNMOUNT DISK ERROR MAC OS X
Tested only on Mac OS X 10.6 “Snow Leopard”. The script requires Growl to be installed in the system. I will make a proper release of the script some time, now you can have a half-baked source code. It uses a volume name to identify the drive. I’d like to emphasize: this script is meant to unmount an entire drive rather than just a volume.

I could, of course, disable sleeping in power settings, but then the drives would be unreasonably wasting power all the time, so I decided to write an AppleScript to mount or unmount a drive depending on it’s state. Some times they “sleep” and while doing so, every file opening dialog, search in Spotlight or search in Dictionary might wake them up and that takes some time. Press Return and type in your admin password if you’re asked for it. For example, ‘disk0s1’ Type: sudo diskutil unmountDisk /dev/disks1 replace ‘disks1’ with the identifier you noted in Step 4.
MAC UNMOUNT DISK ERROR PRO
On my Mac Pro I have two internal hard drives I rarely use. If you get an error message saying cant unmount disk mac terminal, it usually means a process on your Mac is attempting to modify your boot disk but is unable. Note the identifier for the disk you want to unmount.
