Kodi Community Forum

Full Version: iMac (2009) - eject drives?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I got an old iMac (2009, 27") as a gift and wanted to use it as a media center System as i dont have any other use for it at the moment.
It is currently running 10.8.5 and i tried kodi (16.1) and everything works great except that i cant find a way to eject USB Drives or HDDs and if i just remove the drive i get a osx error message that i shouldnt have done this.
Is there a way to safely remove drives under osx directly from kodi? Maybe my osx build is to old?

i thought about just running linux instead but then i would loose the target display mode feature which allows me to connect my ps3 to the system.

Thanks!
Open the Context Menu in the Drive and it should Show "unmount" or something like that?
Do you mean from osx itself? because im looking for a way to unmount those drives directly out of kodi and it wont give me an option in the context menu (only: Play, Add to favourites and Set content) i know on my ubuntu based media center system there is another option to remove the drive but its missing here
Ahh right - on osx the mounting is only handled by the operating system ... nope - no luck for you then.
ah ok thanks... just out of curiosity, why isnt this implemented in the osx builds? cant imagine this is not possible.
im thinking of writing a small addon that will list the drives and let the user unmount it using terminal commands... this should be possible with python or is there some kind of sandbox that would prevent this?
Seems feasible to me. Pointers below.

Use a keymap in kodi to invoke a script which ejects the drive. If the drive always has the same name it is easier ..

This command will list volumes (change it if you don't use HFS):

$ diskutil list | grep Apple_HFS | awk '{print $3}'
HD1000
HD4000
Kodi

This command will unmount the drive "Kodi":

$ diskutil unmountdisk force /Volumes/kodi

Here is an example keymap:

<keymap>
<global>
<customcontroller name="AppleRemote">
<!-- plus --> <button id="1">Up</button>
<!-- minus --> <button id="2">Down</button>
<!-- left --> <button id="3">Left</button>
<!-- right --> <button id="4">Right</button>
<!-- center --> <button id="5">Select</button>
<!-- menu --> <button id="6">Back</button>
<!-- hold center--> <button id="7">runscript(special://home/scripts/stuff.sh)</button>
<!-- hold menu --> <button id="8">ContextMenu</button>
</customcontroller>
</global>
</keymap>

If you get stuck then post the issue ..

Good Luck.