It's possible to enable spinning down of mechanical hard drives using the "Put hard disks to sleep when possible" option in Energy Saver, and it's possible to customize the timeout period with sudo pmset -a disksleep MIN
.
However, if I understand the man pages correctly, this applies to all hard drives connected to the system. Is it possible to only target one HDD (ideally, by UUID)? I have no objection to installing a 3rd party app to accomplish this functionality.
Best Answer
The Terminal command
diskutil eject <disk_identifier>
is what you are looking for.<disk_identifier>
can take the UUID of the drive as an argument.To get the disk identifier of all mounted disks, execute the
mount
command.On my Mac, the
mount
command gives this:To spin down /Volumes/iTunes, I'd execute either one of the commands
diskutil eject /dev/disk4
or
diskutil eject /Volumes/iTunes
.To spin up /Volumes/iTunes, I need to execute the command:
diskutil mountDisk /dev/disk4
.mountDisk
only works with /dev/disk* disk identifiers.See
man diskutil
for more information.