Ejectify

Ejectify automatically unmounts external volumes when your Mac starts sleeping, and mounts them again after it wakes up.

Useful when you have connected a USB drive to a display that powers off when your Mac starts sleeping, causing the drive to be ejected.

Visit