Menu

Cannot resume from hibernate on macbook

fetzer ch
2013-03-13
2016-09-01
1 2 > >> (Page 1 of 2)
  • fetzer ch

    fetzer ch - 2013-03-13

    Hi and thanks for rEFInd!

    I'm using 0.6.7 to dual boot linux and osx on a MacbookPro10,1 (retina).
    Unfortunately I'm seeing the following issue:

    When booting into osx and putting it into hibernate, I'm not able to resume
    any more. The notebook neither reacts on opening the lid nor on pressing the power button. It just stays off and the only way to start is holding power button for a couple
    of seconds or plugging in the power adapter.

    Standby itself works, the problem is there when hibernating or when using the hybrid standby. I've installed rEFInd on osx using ./install.sh. Installing it on esp instead of boot partition does not make any difference. After deinstalling it by rm -r /EF/refind hibernate works again after the next reboot.

    Do you have any hints on how to solve or debug the problem?

    Thanks,
    Christian

    (for testing on osx you can use "pmset hibernatemode 1" to force the system to go immediately into hibernate when closing the lid. When using the default (3) - hybrid standby, you would have to wait the sleep timeout)

     
  • Roderick W. Smith

    Sorry, I'm afraid I don't have the hardware necessary to test this -- on my one Intel-based Mac (an elderly 32-bit Mac Mini), I can sleep, but not hibernate. What's more, as this doesn't directly affect rEFInd itself, I can't create a version of the program with debug messages that would be helpful.

    Ultimately, the cause is likely to be one of two things:

    • The firmware is setting up the environment differently when launching the OS X boot loader (boot.efi) directly vs. when launching rEFInd. If so, then rEFInd could theoretically set up the environment in the same way; but I'd need to know what the firmware is doing, and that would require Apple to publish the information. AFAIK, they're pretty tight-lipped about such things.
    • The firmware is passing "secret" options to boot.efi. This would be relatively easy for rEFInd to do, too, but again I'd need to know what the options are. This would be relatively easy to discover by replacing boot.efi with a program that displays the boot options, but this would prevent OS X from booting. If you've got two OS X installations and so might be willing to test this, I can provide a suitable binary for testing. I'm doubtful that this will yield results, though.
     
  • joevt

    joevt - 2013-04-19

    Maybe this has to do with why rEFItBlesser was created.
    http://refit.sourceforge.net/doc/c4s4_safesleep.html

    But I would think that your MacBook Pro would at least start rEFInd...

    Anyway, you could try installing rEFItBlesser to see if that will fix the problem but you'll need to edit it to work with rEFInd. It's a startup item, so you also need to make sure the owner is set correctly (root:wheel).

    ls -l /Library/StartupItems/rEFItBlesser
    -rw-r--r-- 1 root wheel 72 Mar 7 2010 StartupParameters.plist
    -rwxr-xr-x@ 1 root wheel 3811 Jul 29 2012 rEFItBlesser

    I've attached a version of rEFItBlesser that should work for rEFInd and rEFIt. You just need to edit the variables at the top of the file. rEFItBlesser will need to mount the rEFInd partition if it's not mounted at shutdown (e.g. the EFI partition which is not usually mounted or other partitions that are not the OS partition and are on a removable drive). In that case you will need to edit the slice number since I couldn't find a disk command that will find the slice given a volume name and will work at shutdown. This version of rEFItBlesser will log output to /Users/Shared/rEFItBlesser.log since that's the most appropriate location I could find that will work at shutdown. If you're using the EFI partition, then MOUNTCOMMAND should be mount_msdos instead of mount_hfs. Note: the rEFInd partition needs to be on the same disk as the OS partition because I think other disks may not be available at shutdown.

     
  • Roderick W. Smith

    I advise against using rEFItBlesser. First, it's intended to restore rEFIt as the default boot manager whenever OS X boots, so as to simplify matters after system upgrades that restore OS X's default boot loader. Thus, there's no reason to think that rEFItBlesser will help with a problem with the hibernation feature. Second, I've seen some reports that rEFItBlesser may be causing filesystem corruption on some Macs. Unfortunately, I don't seem to have saved URLs to the original claims, but I seem to recall they were somewhere on the rEFIt bug tracker. Given the minor functionality of rEFItBlesser, IMHO even a slim chance of the program causing filesystem corruption is too great a risk to take, which is why I never created a rEFInd-specific version of the program.

     
  • joevt

    joevt - 2013-04-19

    I think the changes rEFItBlesser does are perfectly reasonable and not much different than how your install.sh script works except for the usage of "bless --info" which you say will cause disk corruption on some systems if the user has an Advanced Format disk. That would be bad if it were true. Has Apple been made aware of that?

    When OS X boots, the currently blessed startup item is either OS X or something else (probably rEFInd). If it's OS X, then rEFItBlesser does nothing. If it's something else, then rEFItBlesser will bless OS X so that if OS X enters Safe Sleep, then OS X will boot out of Safe Sleep correctly without going through rEFInd where the user might inadvertently boot something else causing loss of data from messing with the proper Safe Sleep usage. I think hibernate could work the same way except the OP said the screen was black when attempting to leave hibernate.

    When OS X shuts down, the currently blessed startup item is either OS X (the way that rEFItBlesser sets it to at startup) or something else (meaning the user picked a different startup disk from the Startup Disk preferences panel). If it's OS X, then rEFItBlesser blesses rEFInd. If the user wants to stop using rEFInd then they have to stop using rEFItBlesser.

     
  • Kenneth Johansson

    so I also have this exact problem. Default the system goes into hibernate after 4200 seconds. so if I leave the lid on for this amount of time the laptop cant resume.

    I solved it by setting it to never go into hibernate mode. But a proper solution would be better. thing is that it used to work fine until a month or so ago when I redid my linux installation. could be that I used another bootloader then don't remember what I did the first time.

     
  • Marius Petcu

    Marius Petcu - 2013-05-28

    Ok. So here's a proper and tested version of rEFItBlesser.
    To install it, place the rEFItBlesser folder in /Library/StartupItems and make it owned by root. (chown -R 0:0 /Library/StartupItems/rEFItBlesser)

     
  • Marius Petcu

    Marius Petcu - 2013-05-28

    It's modified to work with an rEFInd installed on / (as installed by install.sh)

     

    Last edit: Marius Petcu 2013-05-28
  • joevt

    joevt - 2013-05-28

    You found some bugs in my rEFItBlesser. I removed my old one from my previous post. Here's a new one with a couple other bug fixes (correct bless command for HFS and FAT partitions, correct path when not using the default / mount point).

     
  • Paul D. Smith

    Paul D. Smith - 2013-05-28

    I'm seeing this same problem, FYI. Seems like it's not that uncommon? I have a MacBook Pro (not Retina) running OSX 10.8.3. Not being able to hibernate is a major loss in functionality...

     
  • joevt

    joevt - 2013-05-28

    Yeah, it seems that if the startup disk is set to rEFInd then hibernate doesn't work properly. That's why rEFItBlesser was created.

    What happens if startup disk was set to something else besides rEFInd or Mac OS X before going into hibernate?

    If rEFInd can't boot after leaving hibernate, then we probably can't get it or any other custom EFI program to display NVRAM variables or any other info that would help us figure out how hibernate works.

    If you don't want to use rEFItBlesser, then you could install rEFInd to a separate 200 MB HFS partition, then use Startup Disk to select Mac OS X as the boot disk. When you want to use rEFInd, hold the option key at startup and select the rEFInd partition.

     
  • Paul D. Smith

    Paul D. Smith - 2013-06-03

    I'm the newbiest noob when it comes to MacOS... but I've been using Linux on all different kinds of hardware for almost 20 years; I've even loaded it from floppy disks. I'm happy to try some stuff but people will have to give me help when it comes to MacOS parts. One thing I wondered: currently when I boot, my Ubuntu partition is selected as the default. Is there a way to change it so MacOS boots by default? Do you think that might help this issue with sleep (if it's really something about not recognizing the partition type correctly)?

     
  • joevt

    joevt - 2013-06-04

    Use Startup Disk in System Preferences.app in Mac OS X to change the default startup disk.

     
  • Will

    Will - 2013-07-18

    Hi Folks,
    I would love to find a solution to this issue - its really bugging me! I have multiple machines so would be able to test at least the 2nd of Roderick's initial suggestions above.

    If you could provide a replacement boot.efi i can check to see if there are special options being passed to the bootloader?

     
  • n808

    n808 - 2013-11-13

    Whew, I am glad I finally found this thread. I've been struggling with hibernate locking up *) my MBP as well as my dad's MB Air. I disabled hibernation to work around it, but would have liked it to work (at least with a longer delay that the 4200 default).

    *) as in shutting down the system to a state where it requires pressing Power a long time for it to start back up.

    I started to suspect rEFInd since when thinking back it started after switching from rEFIt, but at the same time I also upgraded to mavericks. However, what was also common between the two systems was that I switched to rEFInd on both as well as upgraded to mavericks.

     

    Last edit: n808 2013-11-13
  • Roderick W. Smith

    Could somebody with this problem please try installing rEFInd on a non-OS X boot HFS+ volume using the procedure described here:

    http://mjg59.dreamwidth.org/7468.html

    Do not install rEFInd to your OS X boot volume using this procedure! It sets up rEFInd using the filename that OS X uses for its boot loader, so you must use a non-boot HFS+ volume for this. The partition can be a small partition dedicated to rEFInd or a data-storage volume. A dedicated USB flash drive should work for this task. The ESP might also work, if you convert it from FAT to HFS+.

    If you've got such a volume ready, you can use the latest version of install.sh (in the git repository) to automate setting this up. Use the new --ownhfs option, as in ./install.sh --ownhfs /dev/disk0s4 to set up rEFInd on /dev/disk0s4.

    I make no guarantee that this will help, but it might. If it does help, I'd appreciate hearing back about it.

    I've also learned that rEFIt does better with this because of its rEFItBlesser tool. In theory, you could pull that program from rEFIt and install rEFInd under the name /EFI/refit/refit.efi and it should then work better. Unfortunately, I've also seen various problem reports associated with rEFItBlesser (which is why I never included it with rEFInd), so this approach carries some risk.

     
  • n808

    n808 - 2013-11-14

    Roderick: I tried installing rEFInd on its own USB stick using install.sh from git with refind-0.7.5 like this ./install.sh --ownhfs /dev/disk1s2
    Diskutil info:

    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *15.6 GB    disk1
       1:                        EFI EFI                     209.7 MB   disk1s1
       2:                  Apple_HFS rEFInd                  15.3 GB    disk1s2
    

    However, after rebooting, rEFInd on the USB stick is not able to find my OSs, Win 8 and OS X, and only displays options to shutdown and reboot. I am not familiar with manually configuring this, as install.sh has been working without needing manual configuration.

     

    Last edit: Roderick W. Smith 2013-11-14
  • Roderick W. Smith

    Try hitting the Esc key to tell rEFInd to re-scan for new boot loaders. Sometimes it doesn't detect every available boot loader because the firmware is slow in updating its list of available devices.

     
  • n808

    n808 - 2013-11-14

    Thanks - that works. Unfortunately, having the USB stick connected creates a PM assertion, so the system does not even try to hibernate with it connected. It sleeps, just won't switch to hibernation with standbydelay set to 60 seconds.
    I pulled the USB stick out, went away for a couple of minutes, and it hibernated and re-woke without issues (after I had removed rEFInd from HDD for this test)

    pmset -g assertions <snip>
       ExternalMedia                  1
    Listed by owning process:    
       pid 16(powerd): [0x0000000900000206] 00:18:37 ExternalMedia named: 
    "com.apple.powermanagement.externalmediamounted"
    
     

    Last edit: n808 2013-11-14
  • n808

    n808 - 2013-11-14

    I will resize my main HFS partition and create a small empty 1GB HFS partition and try to install rEFInd using the above method, but need to refresh my system backups first.

     
  • Roderick W. Smith

    That sounds promising. If you're not using your ESP for anything else, you should be able to reformat it as HFS+ and use it for this purpose, which would obviate the need to resize partitions to create a new one for rEFInd alone.

     
  • n808

    n808 - 2013-11-14

    Using a separate small partition works - wakeup from hibernation is quick and painless. When I shutdown or reboot I still have to press ESC to see all OSs. It showed only Windows when I first tried.

    I am reading up on ESP on OS X now, as I before now had no knowledge what the ESP is and what it's used for.. I found info in the rEFIt docs indicating it's empty and unused in OS X, except for firmware updates, which will fail if the EFI is deleted.

    So I am not using it for anything else than firmware updates, I guess. Now I have to figure out how to format it to HFS+ safely.. Will firmware updates via the EFI then still work, I wonder.. It seems unlikely, but if a firmware update is needed, perhaps one can go back to EFI format, install the firmware update, then re-format back to HFS+ and re-install rEFInd.

    Would it be possible to summarize why it needs to be re-formatted as HFS+ for this, and not keep it as EFI?

    Also, should I then ./install.sh --ownhfs [EFI device] and not use --esp ?

    EDIT: Adding the separate partition broke the ability to boot into Windows. Windows shows in list of OSs, but when trying to boot to it, "No bootable devices" or some such message shows up.. I restored Windows boot ability by deleting the newly created partition..

     

    Last edit: n808 2013-11-14
  • Roderick W. Smith

    You should be able to get everything to show up without pressing Esc by setting the scan_delay option in refind.conf. Usually setting it to 1 (second) is sufficient.

    If you've already created a separate partition, reformatting the ESP for HFS+ and re-installing rEFInd there shouldn't be necessary, although you can certainly try it. I'd expect firmware updates to continue to work, since the Mac's EFI can read HFS+ just fine.

    Apple's firmware treats booting from HFS+ differently from booting from FAT (which is what ESPs normally use), so I doubt if this procedure would work on a FAT partition. I suppose it's possible that it would, although the --ownhfs option to install.sh definitely should not work (it uses HFS+-specific mount options).

     
  • n808

    n808 - 2013-11-14

    Update (sorry for the many of them):
    I installed rEFInd on the ESP using ./install.sh --esp (install.sh from git) and that seems to fix the hibernation issue without needing to format ESP as HFS+. It woke up from hibernation state right back into OS X. At least I am 99% sure it did, as it took a few seconds longer than normal sleep, and /var/vm/sleepimage was freshly created, just as it did when I temporarily removed rEFInd altogether.
    I did notice the Mac spent longer re-booting with a blank gray screen before displaying the rEFInd UI. But it's still much better having hibernation work instead of shutting down and semi-locking up the computer. I don't reboot and switch OS very frequently.

    After removing rEFInd from the ESP boot times remained very sluggish, but as documented this fortunately cleared up once I installed rEFInd to the boot partition with ./install.sh and then removed it again.

    I might as well try your suggestion to format ESP with HFS+ to see if reboot times are then fast and responsive, but want to be sure I do it correctly, and able to restore it to its current state if something goes wrong. So I backed it up with 'sudo dd if=/dev/disk0s1 of=EFIbackup', disks0s1 being my ESP. I then plan to format it with 'newfs_hfs /dev/disk0s1' once I figure out if that's the right way to format it as HFS+.

     

    Last edit: n808 2013-11-15
  • Roderick W. Smith

    I believe that newfs_hfs should do the trick; or you could do mkfs -t hfsplus from Linux.

    It's also good to hear that an install to the standard FAT ESP might fix the problem, although I expect the issue of a sluggish start into rEFInd that way could be a big problem. As that's not a universal problem, maybe some of those who don't suffer from it could benefit from this approach....

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.