Mac OS X — do not wake up disk after computer wake up

7

2

I have 2 disks in MBP: SSD and regular HDD. I keep only data files on HDD and do not need them often. The problem: even if I eject the HDD drive from Finder or Disk Utility, when macbook is awaken from sleep, OS automatically wakes up HDD. Is it possible to prevent it?

Addition: Ideally it would be cool to make OS not to spin up even mounted drive.

ivanzoid

Posted 2012-08-18T07:48:58.753

Reputation: 447

Is unplugging the disk an option? – terdon – 2012-08-18T15:11:20.583

@terdon what do you mean by unplugging? the disk is inside the notebook – ivanzoid – 2012-08-18T16:17:35.107

Hmm... I guess it is not an option then huh? :) Sorry, since you said "eject" I thought it was an external drive. – terdon – 2012-08-18T16:34:08.140

Answers

1

I think your best bet would be to set the drive to only be mounted manually. I imagine there is a GUI way to do this in OSX but the following, UNIX, approach should also work.

Edit the file /etc/fstab and look for the line mounting the relevant drive. Should be something like:

UUID=a180cec0-xcad-4344-2e19-7b0249ef23b0   /Volumes/foo    hfs rw,auto 0   0

The first field is the disk name or UUID, the second is the mount point, third is the file system and fourth is the options. The last two are for integrity checks and can be ignored for now. Remove auto (if present) from the options field and add "noauto":

 UUID=a180cec0-xcad-4344-2e19-7b0249ef23b0  /Volumes/foo    hfs rw,noauto 0 0

terdon

Posted 2012-08-18T07:48:58.753

Reputation: 45 216

The disk isn't mounted since he ejected it before sleeping. But it's apparently starting to spin despite that. – Daniel Beck – 2012-08-18T16:45:58.137

@DanielBeck I know, but I figure that when the computer wakes up, it reads fstab and mounts what needs to be mounted. If the drive is set to not automount I would expect it to remain asleep. – terdon – 2012-08-18T16:49:13.043

@terdon, wow, it looks that /etc/fstab is no longer used in Mountain Lion. :( It's only /etc/fstab.hd exists with the following contents: http://pastebin.com/T6cZne4t

– ivanzoid – 2012-08-18T17:13:47.147

@ivanzoid terdon wanted to address you in his above comment. – Daniel Beck – 2012-08-18T17:34:18.120

According to this question, fstab is still valid just not created by default. Try adding the line I suggested and see how it goes. @DanielBeck, I hope it is :)

– terdon – 2012-08-18T18:15:55.460

@terdon I tried, unfortunately it doesn't help. I mean, it seems to be working — volume is not auto-mounted after reboot, but it does not prevent drive from spinning up when computer leaves sleep – ivanzoid – 2012-08-19T04:42:07.120

@terdon, aha, the funny thing is that after I added this line to /etc/fstab I'm no longer able to mount the drive even from Disk Utility! ;) Removing the line restored the functionality. – ivanzoid – 2012-08-19T06:46:32.623

@ivanzoid Well, that's no good... – terdon – 2012-08-19T12:02:34.910