Disable or sleep secondary hard drive in Macbook
I do not agree with deijmaster. A SATA port is a SATA port. It does not make any difference to the OS that it's usually used for DVD.
I have also moved my HDD to the optical bay.
The best thing I have found so far to reduce noise is:
- Make sure that you enable disk sleep in Energy preferences.
Then, run in Terminal:
sudo pmset -a disksleep 1
To sleep the disk after only 1 minute.
Also, if you disable Spotlight on this drive, the drive will not spin up when you open Spotlight. To disable spotlight:
sudo mdutil -i off /Volumes/TSA-Data
(Or the conventional way: drag the drive (all partitions) from the Finder sidebar to the list of places that Spotlight excludes, in the Spotlight Preferences)
It still spins up some times without obvious reason.
I made the following compact script with help from earlier answers. The script mounts and opens the secondary drive (disk1, here "HDD") if it isn't mounted, and ejects it if it is mounted.
I also reduced the the idle time to 1 min (in terminal: sudo pmset -a disksleep 1
) and placed "HDD" in the list of Spotlight exceptions where it reappears every time it's mounted.
Then, the disk won't start too often but will go back to rest quickly, when mounted of course. Note also that unmounted disks can start when using e.g. system info and disk utility.
Use the correct disk name instead of "HDD" below!
The script MountHDD.scpt
:
tell application "Finder"
if not (exists the disk "HDD") then
do shell script "diskutil mountDisk 'disk1'"
tell application "Finder"
activate
make new Finder window
set target of Finder window 1 to disk "HDD"
end tell
else
do shell script "diskutil eject 'disk1'"
end if
end tell
Save the script as a program (.app) and place the program in Dock!
Note that the disk still spinns up (unmounted) at boot and wake up. Run the app once/twice (mounted/unmounted) to sleep it. if you do nothing it will spin the idle time (1 min if sudo pmset -a disksleep 1
is used) and then stop.
So I also did some of the Googling and found nothing that really helped. After combining some stuff I found running
hdiutil eject disk1
in Terminal to work. If you get info in Disk Utility you can see if the drive you want to eject is disk0 or disk1 or whatever. I find some times the disk will spin back up if I do things like open Disk Utility again.