Quick tip - save your MacBook's hard drive

Recently I've gotten a couple of e-mails from folks that have had problems with hard drive failures in their MacBooks. While hard drive failures are a fact of life with nearly any computer it can be exacerbated in laptops and portable machines where the risk of drops while the drive is spinning is significantly higher.

One of the features I really love about my MacBooks (both my original MacBook and my MacBook Pro) is how reliable the sleep function is; close the lid and the MacBook's screen goes dark and you are ready to run off. The reality is that by default the machine does not immediately go into sleep mode but starts the process of writing the contents of your memory to your hard drive.

This means that when you think the machine is inert, the reality is that one of the more sensitive moving parts (hard drive) is writing to disk. Depending on the amount of memory you have in your machine this may take a while to do; in my case with a MacBook Pro and 4GB of RAM it takes a little over 10 seconds.

You can modify your MacBook to simply drop into sleep mode immediately by opening a terminal window and running the following command:

sudo pmset -a hibernatemode 0

This means your machine will drop into sleep mode nearly instantaneously. Hendrik, a frequent contributor here and the author of Juxtaposer, pointed me to this excellent article by Rob Griffiths in MacWorld from a couple of years ago. A great read if you want more details on this setting.

If you don't make this change you should keep an eye on your sleep indicator on the outside of your MacBook; don't move the machine after closing the lid until that light is steadily pulsing.

Got a quick tip to help MacBook and MacBook Pro users to keep their hard drive's safe? Please drop it into the comments below.

Comments

Anonymous said…
You do realize that the HD in a notebook computer is designed to take some abuse. Mind you, it probably wouldn't take being dropped on the floor, but it should be able to handle being picked up and moved around.

Where I work now, we move notebook computers around all the time while they are fully awake. No problem what so ever.
David Alison said…
@VesperDEM: Yes, they are designed to handle more abuse but one of the folks that told me about his hard drive problems had a tendency to snap the MacBook shut and then drop it (however gently) into his laptop case. The AppleCare technician told him that that was likely the cause of the damage to the hard drive.

Silver Mac has an article about the problem as well.
brian said…
I emailed Dave recently about my girlfriend's and my Macbooks. Both were less than a year old, and both HDs failed within 2 weeks of each other. You'd be surprised at how long that sleep light takes to start pulsing. I've timed it around 30 seconds on occasion. That's a long time to just sit there and stare at it while you're in a coffee shop ready to leave. With the new HD, we both changed our settings to have it sleep immediately.
Anonymous said…
Odd. This might be the case with Intel machines. My PowerBook does not hibernate and goes to sleep whenever I close the lid. When I upgraded from Tiger to Leopard I was pleasantly surprised to see that it went to sleep even faster (about a second, sometimes less).

Thanks for the heads up, Dave. I'll keep that in mind when I go Intel one day.
Anonymous said…
I installed the free SmartSleep preference pane on my wife's MacBook and my MacBook Pro. It allows you to choose between 4 different sleep options, including smart sleep, which performs the same function that the above terminal command performs, and, in addition, allows you to define a minimum battery charge level that your machine must reach before the memory contents are written to the hard drive. Here is the link to the developer's website:

http://www.jinx.de/SmartSleep.html
Azhar said…
@Above

It's safe to move around a laptop when awake because the SSM (Sudden Motion Sensor) is actively compensating for your movements. However, when it is undergoing to process that David just described, SSM isn't active. Hence, the potential damage.
Unknown said…
A preference pane I would like to recommend is iLid, a piece of donationware by EGO Systems Inc. iLid does a good job of keeping my MacBook Pro from accidentally waking up while still in the laptop bag. http://www.ego-systems.com/Products/ilidprefpane.html
saveourcats said…
Another worthwhile plugin is the free SMARTreporter, which lives in the menubar and polls the SMART status of yr HD, (hopefully) alerting you before it fails. More here:

http://www.corecode.at/smartreporter/
Anonymous said…
Is there any risks or downsides with doing the modification?
If not it seems like something that can be really beneficial.
David Alison said…
@Anon: No real risk to it except one: if your MacBook's battery dies completely while in sleep mode then you will lose what you are working on. For the vast majority of people this should not be a problem but if you have a tendency to run your batteries right down into the danger zone AND don't have access to power AND like to put it to sleep in that state then this is not a good modification to make.

Hope that helps...
Anonymous said…
I think if all I have to do before moving the laptop is wait for the sleep light to start pulsing, then that is a more palatable suggestion than digging around in Terminal issuing root-user commands. Can you verify that the light starts pulsing only after the hard drive has stopped spinning?

Thanks in advance for double checking,

-cDizzle
Anonymous said…
Hi David,

Hope you are doing good. Wanted to check with you if you found a good shareware or freeware to lock your mac like in XP without logging out. I found a freeware called screenlock. But was wondering if you use any?

Cheers,
Bharat
David Alison said…
@cDizzle: Yep, the pulsing means that it is finished writing to the hard drive and that everything is safe. If you only have 512MB or 1GB it may not be that slow for you and is not as big of a deal. When I snap that lid shut I generally want to move quickly, hence the modification. I would dismiss it as "digging around in the terminal" - you're really just poking at a setting that has been surfaced in the control panel. There are lots attributes that can only be set that way right now.

@Bharat: Thanks for the tip on screenlock. I don't use anything on my Mac Pro since it's in my house and, as such, pretty safe. On my MacBook Pro I have it set to prompt me for my login when it comes out of sleep mode; that seems to work best for me.
Anonymous said…
yes, you can lock the screen using a built-in feature. Under the "Security" section, put a check in the box to require a password when waking from sleep or the screensaver. Then, set a hot corner to turn on your screensaver - then you can just move your mouse to the hot corner and your computer is unusable without the password. This essentially does the same thing as locking a windows machine.
Anonymous said…
After two and a half years of rolling my laptop over parking lots, curbs, and who knows what else, the hard drive crashed. From now on I'll carry it in its case and just carry books in the wheelie.
ECulver

Popular posts from this blog

Keyboard vs. Mouse

Some cool Firefox add-ons

A hardcore Windows guy gets a Mac