nielsmouthaan / ejectify-macos

Ejectify automatically unmounts external volumes when your Mac starts sleeping, and mounts them again after it wakes up.
https://ejectify.app
Other
369 stars 50 forks source link

Mount only after the display turns on #60

Open polochamps opened 1 year ago

polochamps commented 1 year ago

Hello Niels,

I'm still experiencing issues with the "disk not ejected properly" notifications. I would like to provide specific details about the components I'm using and can provide more information if necessary. Here are the details:

I have already tried using the "Unmount when display turned off" and "Unmount when system starts sleeping" options, but I'm still receiving the notifications. I came across a post on MacRumors suggesting that the Mac mini might be waking up periodically due to the "Wake for Network Access" setting in Energy Saver preferences. This causes the monitor's USB hub to receive power, resulting in the reconnection of the external drive (Intel 670p). Shortly afterward, the Mac goes back to sleep, and the cycle repeats, triggering the numerous notifications.

Based on my limited knowledge, do you think it would be possible to have an option that only mounts the drive when the screen is awake? The idea behind this is that when the system wakes up due to network access, Ejectify could automatically mount the drive but not automatically unmount it when the system goes back to sleep.

Thank you for your assistance and any insights you can provide.

*added text (Ventura 13.4)

polochamps commented 1 year ago

My guess is that when the Mac wakes up for network access, it may grant exclusive access only to the programs that requested it. As a result, Ejectify is unable to unmount the drive during this wake-sleep cycle.

polochamps commented 1 year ago

If my understanding is correct, I would like to suggest adding an option to mount the volumes exclusively when the display is on. It appears that the current option is configured to automatically mount volumes when the system or screens wake up, but it does not specifically cater to mounting them only when the display is on.

nielsmouthaan commented 1 year ago

Right now, Ejectify unmounts only when the display turns on (again) when you select the Display turned off option is selected.

I suggest taking a look at this FAQ to diagnose what causes the volume not to be unmounted. It could also be that your volume is encrypted; some have reported issues related with this.

polochamps commented 1 year ago

To clarify, my suggestion is to add an option in Ejectify that allows mounting the drive only when the display is turned on. This would prevent the drive from being mounted during the wake-sleep cycle caused by the "Wake for Network Access" feature.

The issue seems to be that Ejectify currently unmounts the drive only when the display turns on again. As a result, the drive remains mounted, during the wake-sleep cycle caused by the "Wake for Network Access" feature. This means that when the system goes back to sleep (from the wake-sleep cycle), the drive is still mounted.

Volume is unencrypted.

polochamps commented 1 year ago

What I'm suggesting is to keep the volume unmounted during sleep and have it automatically mount only when the monitor is awake or turned on.

nielsmouthaan commented 1 year ago

This is what Ejectify suppose to do. It unmounts when your display turns off, and only unmounts it when your display turns on again. This is assuming you have set Unmoun when to Display turned off.

polochamps commented 1 year ago

I apologize, if I don't make myself clear. Yes, Ejectify unmounts when display is turned off but what I'm saying that it should remain unmounted during system sleep. Or if in case the system wakes because of "network access", the volume should remain unmounted.

It will only mount volumes again when two conditions are met. Both system and display are awake.

nielsmouthaan commented 1 year ago

Ejectify won't remount the drive as long as your display is turned off, but perhaps macOS does. You can check the Console app to check whether that's really the case. If so, this might be a valid feature request, although Ejectify needs to deal with a lower-level component to avoid macOS mounting the volume (if possible).

polochamps commented 1 year ago

Buy Ejectify is advertised as "Automatically mounts volumes again when your Mac or screens wake up, optionally after a delay." I'm confused.

nielsmouthaan commented 1 year ago

I updated the comment