On startup, I eject my external USB disks with the following AppleScript:
try do shell script "diskutil eject \"/Volumes/USB Backup\"" end try
This works as expected: the drive powers down. However, when my MacBook wakes from sleep (through not being used), the drive spins up - no partitions are mounted, but the drive is nonetheless on and humming. If I check the Disk Utility app, I see that the USB drives are all greyed out. If I right click one of the partitions and select "Eject Partition" (even though they are gray and thus symbolize that they are ejected) then the drive powers down.
It is however a little anoying to constantly have to go into Disk Utility, so I made though I could just re-execute my logon script. But that doesn't work. Even if I modify it to work with the DeviceIdentifier
do shell script "diskutil unmountDisk disk1"
do shell script "diskutil eject disk1"
it doesn't work. Does anyone have a tip for me how I can power down the drive, so that this horrible humming stops?
Later Addition: I noticed something interesting. It has nothing to do with the laptop's sleep mode itself, but rather when my Cinema Display goes to sleep (after 1 min.). The USB drive is connected to the Cinema Display and every time the display "wakes up", the drive motor spins up. I have now tried to connect the USB drive to the MacBook Pro itself (who's sleep timer is at 30 min.) maybe this will solve the problem half-way.