Sponsored in part by... Mark/Space, Inc. MARK/SPACE, INC: The Missing Sync provides the very best in
synchronization for Mac users with BlackBerry, Palm OS, or
Windows Mobile devices. Integrates with Address Book, iCal,
Entourage, iPhoto, and iTunes. <http://www.markspace.com/bits>

 [F] TidBITS  / TidBITS  / TidBITS Talk  /

Safe Sleep Revisited

[Robert, Ollivier]Ollivier Robert - 02:08am Aug 17, 2007 PST
Guest User

Hello, just a small nit:

rewrite

MODE=`/usr/bin/pmset -g | grep hibernatemode | awk '{ print $2 }'`

into

MODE=`/usr/bin/pmset -g | awk '/hibernatemode/ { print $2 }'`

You don't need the extra grep at all.

Cheers,
Ollivier



Mark as Read
  OutlineAll MessagesOlder MessagesOldest MessagesNewest MessagesNewer Messages

John Gordon - Aug 17, 2007 2:11 am (#1 Total: 19)  

Reply to this message
Guest User  

Photo of Author
Posts: 1
Safe Sleep Revisited

You mentioned in your personal blog post that one of the responses to
your first article was something along the lines of "It doesn't take
MY computer 49 seconds to sleep". Well, I didn't give that response
before, but it certainly doesn't take my computer that long to sleep,
and I'm not sure why. I'm using a core duo MacBook with 2GB of RAM,
and I haven't adjusted any save sleep settings. The "sleep light"
comes on between 1 and 5 seconds after closing the computer.

Joe Kissell - Aug 17, 2007 2:11 am (#2 Total: 19)  

Reply to this message
 

Photo of Author
Posts: 1278
You mentioned in your personal blog post that one of the responses to your first article was something along the lines of "It doesn't take MY computer 49 seconds to sleep". Well, I didn't give that response before, but it certainly doesn't take my computer that long to sleep, and I'm not sure why. I'm using a core duo MacBook with 2GB of RAM,


The time it takes to save the RAM cache is roughly proportional to the amount of RAM you have. So, all things being equal, my computer with 4 GB of RAM might take twice as long as yours.

and I haven't adjusted any save sleep settings. The "sleep light" comes on between 1 and 5 seconds after closing the computer.


The thing to notice is not when the light comes on (as it does on all Mac laptops, including mine, right after you close the lid) but when it starts *pulsing*. According to Apple, only then is it safe to move your computer, as that signifies it has finished writing your RAM to disk and fully entered sleep mode.

Joe

D.E.Cohen - Aug 21, 2007 2:48 am (#3 Total: 19)  

Reply to this message
 

Photo of Author
Posts: 3
Re: Safe Sleep Revisited

The script turns off safe sleep when battery level is above 50% I assume this means it will turn off if on mains and fully charged, but want to check this. Also, what about on mains power with less than 50% battery?

[The script doesn't care about whether you've got AC power or not - it only looks at your battery level. So, with or without AC power, it turns hibernatemode on at under 30% charge and off over 50%. -Joe]

Marlee - Aug 22, 2007 4:23 am (#4 Total: 19)  

Reply to this message
 

Photo of Author
Posts: 2
Re: Safe Sleep Revisited

Hi, is this feature turned off if you select never put laptop to sleep? I was not aware of the fact that I'm not supposed to move my computer for 45 sec. after I close it and I have been dragging it all over when I wasn't supposed to. How big of a problem is this? Thanks, Marlee

Lewis Butler (apparently) - Aug 22, 2007 11:05 am (#5 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 1125
Re: Safe Sleep Revisited

I may have missed something along the way, but is it possible to set
your laptop to ALWAYS safe-sleep when it sleeps, and not just when it
drains the battery?

I mean, yes, I know it safe-sleeps when you put it to sleep, but it
stays in it's low-power sleep mode also, and doesn't totally power-
off the laptop until the battery drains. I sometimes go many days
without using the laptop and would very much prefer it have a full
charge after that time without my having to physically remove the
battery...

Mark H. Anbinder (apparently) - Sep 19, 2007 5:43 am (#6 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 485
Re: Safe Sleep Revisited



My recent MacBook battery issues reminded me of this recent
discussion, and I came back to finish reading the messages I hadn't
yet read. I DO like the idea of safe sleep, but unfortunately, my
laptop has been spontaneously powering off without the chance to go
into safe sleep mode.

I guess the MacBook is getting inaccurate data from the battery as to
how charged it is, or something, but these spontaneous shut-offs are
happening when it claims to be around 30% full. It almost never gets
to the "red" menu-bar icon state, and hasn't given me a low-battery
warning in ages.

When this happened this morning, after an hour at a coffee shop, I
pushed the battery's button and got one solid and one blinking LED,
which you'd think would be enough to keep powering the machine a
little longer!

I'm hoping to find someone who's willing to swap batteries for a
couple of days to see if the problem stays with the battery or the
laptop. If anyone has any other suggestions, I'm all ears! I never
actually followed Joe's instructions for fiddling with the safe sleep
mode settings, but I might give it a try to make sure it's set
properly.

  Mark H. Anbinder
  Contributing Editor, TidBITS

Bryan.Walls687 (apparently) - Sep 20, 2007 12:08 pm (#7 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 6
Re: Safe Sleep Revisited

Have you done a battery calibration, per the Apple recommendations at
http://docs.info.apple.com/article.html?artnum=86284?

I was having issues similar to yours for a while. Currently I'm
seeing rather short battery life, but at least the machine is
sleeping rather than just dying when it runs out.


--
Bryan Walls My words are not NASA policy.
Bryan.Wallsnasa.gov (256)544-3311 voice,544-1070 fax

Nik (apparently) - Sep 20, 2007 12:08 pm (#8 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 385
Re: Safe Sleep Revisited

On 9/19/07, Mark H. Anbinder <mhatidbits.com> wrote:
> I guess the MacBook is getting inaccurate data from the battery as to
> how charged it is, or something, but these spontaneous shut-offs are
> happening when it claims to be around 30% full. It almost never gets
> to the "red" menu-bar icon state, and hasn't given me a low-battery
> warning in ages.

Yup, that can happen. All you need to do is recalibrate the battery by
going from fully charged to fully discharged and then back to fully
charged.

From Apple's support doc on the process:

1. Plug in the MagSafe power adapter and fully charge the MacBook or
MacBook Pro battery until the light on the MagSafe connector changes
to green and the Battery icon in the menu bar indicates that the
battery is fully charged.

2. Allow the battery to rest in the fully charged state for two hours
or longer. You may use your computer during this time as long as the
power adapter is plugged in.

3. Disconnect the power adapter with the computer on and start using
it with battery power. When the battery's charge gets low, you'll see
the low battery warning dialog on the screen.
Continue to keep your computer turned on until it goes to sleep. Save
your work and close all applications when the battery's charge gets
low and before the computer goes to sleep.

4. Turn off the computer or allow it to sleep for five hours or longer.

5. Reconnect the power adapter and leave it connected until the
battery is fully charged. You may use your computer during this time.

<http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh2339.html>

That should fix the problem for you.

--Nik

Jeff Porten (apparently) - Sep 20, 2007 12:26 pm (#9 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 347
Re: Safe Sleep Revisited

On Sep 19, 2007, at 8:43 AM, Mark H. Anbinder wrote:

> My recent MacBook battery issues reminded me of this recent
> discussion, and I came back to finish reading the messages I hadn't
> yet read. I DO like the idea of safe sleep, but unfortunately, my
> laptop has been spontaneously powering off without the chance to go
> into safe sleep mode.

I see similar weirdnesses on my MacBook (1st gen Core 2 Duo). I
turned off the safe sleep feature when I read Joe's article, and was
happy to see the return of instant sleep. But the downside is that
if I leave the machine sleeping without AC, the power goes out
entirely and I have to reboot from scratch.

My experience with other PowerBooks is that when the battery "runs
out", there's enough juice for at least another 48 hours of sleep.
I'm still adjusting to "when we tell you the battery is low, we MEAN
IT", and debating whether to turn safe sleep back on. It's *really*
annoying to wait for a few minutes for safe sleep to restore the
state of the computer when there was nothing going on at the time --
on the other hand, it's only a matter of time before I lose something
important at this rate.

Best,
Jeff

johnbaxterlists (apparently) - Sep 21, 2007 1:08 am (#10 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 667
Re: Safe Sleep Revisited

On Sep 20, 2007, at 12:08 PM, Nik Friedman TeBockhorst wrote:

> On 9/19/07, Mark H. Anbinder <mhatidbits.com> wrote:
>> I guess the MacBook is getting inaccurate data from the battery as to
>> how charged it is, or something, but these spontaneous shut-offs are
>> happening when it claims to be around 30% full. It almost never gets
>> to the "red" menu-bar icon state, and hasn't given me a low-battery
>> warning in ages.
>
> Yup, that can happen. All you need to do is recalibrate the battery by
> going from fully charged to fully discharged and then back to fully
> charged.

The closest the original poster can get to the Apple method is to let
the machine rest for the 5 hours after it cuts off (not goes to
sleep) when claiming 30% charge. The machine can't be fully
discharged if the 30% is to be trusted.

But doing the 5 hour rest part after the cutoff is certainly worth a
try. (So is finding the battery serial number on a previously
overlooked recall list, but I don't think there are any that cover
that one.)

   --John


Mark H. Anbinder (apparently) - Sep 22, 2007 3:10 am (#11 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 485
Re: Safe Sleep Revisited



John says...

> The closest the original poster can get to the Apple method is to let
> the machine rest for the 5 hours after it cuts off (not goes to
> sleep) when claiming 30% charge. The machine can't be fully
> discharged if the 30% is to be trusted.
>
> But doing the 5 hour rest part after the cutoff is certainly worth a
> try.

Thanks for the thoughts, John and all! When I posted, I'd actually
already tried getting as close to that procedure as I could. As you
point out, it's not fully discharged, as evidenced by the Mac's
displayed percentage and by the LEDs on the battery itself. I helped
it discharge further by trying to start it up a few times. :-)

After this, the first time I let the battery run down, it
successfully brought up the low-power warning and went to sleep.
Since, it has spontaneously shut off at a too-high charge level. So,
I'm not sure where it stands.

A private response suggested there's a known problem with a
temperature sensor on some MacBooks, and Apple should fix it, but I
haven't had a chance to look into this.

Thanks, everyone!

  Mark H. Anbinder

Nik (apparently) - Sep 25, 2007 1:35 am (#12 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 385
Re: Safe Sleep Revisited

On 9/22/07, Mark H. Anbinder <mha14850.com> wrote:
> As you
> point out, it's not fully discharged, as evidenced by the Mac's
> displayed percentage and by the LEDs on the battery itself. I helped
> it discharge further by trying to start it up a few times. :-)

The LEDs and the battery monitor on your Mac will ALWAYS agree with
one another. The battery itself is what reports its charge, not your
Mac. So if the battery THINKS it has a 30% charge, that's what the Mac
will think.

My guess is that your battery is terribly mis-calibrated, and is just
running out of power long before it's "smart" chips realize it's low
on power. So when your Mac turns off, the battery is actually
discharged. (Unless I'm missing facts here that prove otherwise.)

Regardless, your problem is almost certainly limited to your battery
and not to your Mac. It's POSSIBLE there's some problem on your Mac,
but not terribly likely given how repeatable these symptoms are.

If you want to make sure you can fully discharge your battery, just go
into single-user mode and let it sit around at the command prompt for
a long time. AFAIK, there are no utilities that will either heat up
nor sleep your Mac while in that mode. It'll take a while to
discharge, but it ought to do it. Then try recalibrating from there.

--Nik

Mark H. Anbinder (apparently) - Sep 25, 2007 2:01 am (#13 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 485
Re: Safe Sleep Revisited



Thanks again to everyone for the suggestions and info! I was pleased
to discover today that my battery will be replaced free by Apple,
even though the MacBook is out of warranty.

      http://www.apple.com/support/macbook_macbookpro/batteryupdate/

Apple is replacing MacBook or MacBook Pro batteries at no charge up
to two years from the purchase date, if they're exhibiting one of the
following symptoms:

     * Battery is not recognized causing an ³X² to appear in the
battery icon in the Finder menu bar.
     * Battery will not charge when computer is plugged into AC power.
     * Battery exhibits low charge capacity/runtime when using a fully
charged battery with a battery cycle count (as shown in System
Profiler) of less than 300.
     * Battery pack is visibly deformed.

My timing was perfect; I'm up to 267 cycles as of today, and in a few
more weeks I wouldn't have been covered! As it is, I spoke to someone
this afternoon and a free replacement battery is en route.

(Don't you love happy endings?)

  Mark H. Anbinder | mhatidbits.com
  Contributing Editor, TidBITS | http://www.tidbits.com/

JolinWarren (apparently) - Oct 14, 2007 3:46 am (#14 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 153
Re: Safe Sleep Revisited

At 14:58 on 2-10-2007, tobysayre wrote:
> Is it safe to move the MacBook around when it's NOT going through
> the safe sleep process, i.e. when the screen is up and on and
> whatnot?

I wondered the same thing -- how is the safe sleep process any
different than the Mac just being on normally. I frequently move my
computer around when it's on and have done for many, many years.

_________________
=> Jolin

jwbaxter (apparently) - Oct 16, 2007 3:27 am (#15 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 70
Re: Safe Sleep Revisited



On Oct 14, 2007, at 3:46 AM, Jolin M Warren wrote:

> At 14:58 on 2-10-2007, tobysayre wrote:
>> Is it safe to move the MacBook around when it's NOT going through
>> the safe sleep process, i.e. when the screen is up and on and
>> whatnot?
>
> I wondered the same thing -- how is the safe sleep process any
> different than the Mac just being on normally. I frequently move my
> computer around when it's on and have done for many, many years.

It's not completely safe to move the laptop around any time it is not
off or really asleep. (Or safe to "slam" in around any time.)

It is sort of safe if nothing has happened "recently", IF the drive
retracts its heads when idle (I don't know). And I do it, as most of
us do--for example to show someone not behind us the screen.

The extra problem with the period when the drive is going into safe
sleep is that the drive is busily writing, moving its heads (even if
only by a single track) and with the heads in the vulnerable part of
the drive.

Of course, I came to this disk drive paranoia naturally--in the pre-
production days in the 1960s on NCR's new disk drive (for new a
computer system), the mean time between crashes was demonstrably less
than the time it took to load the system software onto the drive from
cards. (It took 5 attempts before the load was completed before a
crash--mercifully we got a copy made to a second drive before either
crashed.)

   --John (in those days, the industry was having trouble deciding
between "disk" and "disc"--informally and internally, we settled on
"disckque")


Lukas Mathis - Oct 16, 2007 3:27 am (#16 Total: 19)  

Reply to this message
Guest User  

Photo of Author
Posts: 1
Re: Safe Sleep Revisited

> I wondered the same thing -- how is the safe sleep process any
> different than the Mac just being on normally. I frequently move my
> computer around when it's on and have done for many, many years.

It's not different. Generally, you should not move any electronics
with spinning things inside. That includes hard disks and CD/DVD
drives. It's been a few years since I've had physics lessons, but I
think it has something to do with torsion. The force you apply to your
computer may have unpredictable effects on the spinning things inside
it. If a hard disk's read-write head touches the surface of a platter,
your disk is probably toast.

Modern MacBooks will turn the disk off if you move the computer too much.

Most manufacturers seem to tell people not to move their electronics
while it's in use if there might be issues. For example, there was an
problem with an early batch of Xbox 360s which scratched DVDs when the
Xbox was moved while the disc was spinning. The 360s actually had a
sticker on the drive telling people not to move the console while a
disk was inside. Don't know if current Xboxes still have that issue,
and I don't know whether Apple advises owners of MacBooks to not move
the computers while in use.

lukas

brian.hannon - Oct 16, 2007 3:33 am (#17 Total: 19)  

Reply to this message
 

Photo of Author
Posts: 7
Re: Safe Sleep Revisited

Well, you see, when it's safe-sleeping, the computer is actively writing large quantities of data to the hard disk. So there's a greater risk of damaging the hard drive than if you pick your laptop up and move it around while it's not doing much of anything. In both cases, there's some risk, but I'd guess it's small - people have been moving laptops around while running for 15+ years, and hard drives are quite reliable. You are backing up your data, right? ;)

If you were to drop the laptop while it's running, that would be another matter. The accelerometer inside is supposed to sense that and park the hard drive heads before the computer hits the ground, saving your data. I wonder if that system works if you drop your computer while it's starting to sleep?

Lewis Butler (apparently) - Oct 17, 2007 5:34 am (#18 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 1125
Re: Safe Sleep Revisited

On 16-Oct-2007, at 04:27, John W Baxter wrote:
> in those days, the industry was having trouble deciding
> between "disk" and "disc"

"Disk" is a hard disk, a floppy disk, or pretty much any other thing
you might call a disk (zip, MO, ez135, etc) except

"Disc" is a CD or DVD or similar shiny round bare thingy, including
the new BluRay/HD Discs.

Arbitrary? Sure. But it works for me.

Basically, it it is shaped like a discus, it's a 'disc'. If it's a
box with a disc platter of some sort inside it, it's a 'disk'.

johnbaxterlists (apparently) - Oct 18, 2007 3:37 am (#19 Total: 19)  

Reply to this message
via email  

Photo of Author
Posts: 667
Re: Safe Sleep Revisited

On Oct 17, 2007, at 5:34 AM, Google Kreme wrote:

> On 16-Oct-2007, at 04:27, John W Baxter wrote:
>> in those days, the industry was having trouble deciding
>> between "disk" and "disc"
>
> "Disk" is a hard disk, a floppy disk, or pretty much any other thing
> you might call a disk (zip, MO, ez135, etc) except
>
> "Disc" is a CD or DVD or similar shiny round bare thingy, including
> the new BluRay/HD Discs.
>
> Arbitrary? Sure. But it works for me.

And that is how it has shaken out over the years (as newfangled
things appeared). In the 1960s, it was far from clear cut, CDs
didn't exist, and the battle between disc and disk raged, with the
que ending having lots of support, too (mostly from Europe). That's
why we (internally) gave up and used disckque (except we had to
remember not to in formal documents).

And there isn't a "d" in sight in the earlier Ramac, despite the
round spinning platters (multitudes of platters) it used.

   --John



  OutlineAll MessagesOlder MessagesOldest MessagesNewest MessagesNewer Messages


 [F] TidBITS  / TidBITS  / TidBITS Talk  / Safe Sleep Revisited




Add a message

To add a message to this discussion, you must be a registered user. Enter your email address below. If you have an account associated with the email address you enter, you will be prompted for your password. If not, you'll be able to create a new account with no fuss.

Enter your email address:

Submit