On Sat, December 27, 2014 4:53 pm, Christopher Gregory wrote:
> Hello,
>
>
> I am trying to get hibernate to work correctly with my laptop as we
> periodically have powercuts and I would like the contents saved to the swap
> partition so when the power comes back on I can resume where I left off.
>
> I use GUID Partition Table (GPT) and UUID= and PARTUUID= to describe my
> partitions both in grub.cfg (where for mysterious reasons I have to have
> the root= partition use PARTUUID=)
>
> Please also note that THIS IS ON A SYSTEMD SYSTEM.
>
>
> I have the following set in grub.cfg:
>
>
> menuentry "GNU/Linux, Linux vmlinuz-3.17.6-lfs-20141209-systemd" { linux
> /vmlinuz-3.17.6-lfs-20141209-systemd
> root=PARTUUID=3c1bdec4-6be6-4d66-8d88-76b9e50bb7ce rootdelay=15 ro
> resume=UUID=2280a26b-4ff4-4dde-9848-0d9bbc999de5
>
> Please note that as this is an external USB hard drive the rootedelay
> option is REQUIRED. I have also placed the resume=UUID line before the
> rootdelay= option and it has made no difference.
>
> I have also rebooted before testing the pm-hibernate command.
>
>
> I do have acpid installed and have correctly changed the grep line. The
> contents of the files are:
>
> root [ ~ ]# cat /etc/acpi/events/lid event=button/lid
> action=/etc/acpi/lid.sh
>
> root [ ~ ]# cat /etc/acpi/lid.sh #!/bin/sh
> /bin/grep -q open /proc/acpi/button/lid/C235/state && exit 0
> /usr/sbin/pm-hibernate
>
>
> I also have pm-utils-1.4.1 installed.
>
>
> I have not put anything in /etc/pm/sleep.d or altered anything in
> /usr/lib/pm-utils/sleep.d.
>
>
> When I issue the command pm-hibernate the screen goes black for a few
> seconds, then comes back to normal and then after a few seconds shuts the
> computer down as it is meant to do.
>
> When I restart the computer, it does not resume at all. It just does a
> normal restart. There is an option within the kernal configuration that I
> set to /dev/sdb12 for the suspend to disk (hibernate) option. So that
> is compiled into the kernel.
>
> The pm-suspend-hybrid seems to work as designed and suspends the system,
> and when I press the power button a few minutes later it resumes the
> session.
>
> When I close the laptop lid the same result happens for pm-hibernate, ie
> normal boot rather than resuming.
>
> I have absolutely no idea how to solve this. This is the first time that
> I have seriously tried this as I really need to get it working.
>
>
> Do any scripts have to be put in /etc/pm/sleep.d?
>
>
> I also have UPower-0.99.2 installed.
>
>
> The exact same behaviour of hibernate occurs if within lxde I click on
> the hibernate button.
>
> I must say that I am running these tests as root. If they do not work as
> root then I do not think they will work as my normal user either. I
> like working directly as root for building the system and then revert to a
> normal user after I have things the way I want them.
>
> Regards,
>
>
> Christopher.
Hello,
What a mission this turned out to be!
After a number of hours googling, and reading other major distro's wiki's
and mailing listst I have managed to solve this.
The issue is that systemd, and I strongly suspect the same is the case for
pm-utils as well, although I can not find an exact answer for that tool,
uses the kernel's native swsusp for handling suspend/hibernate/resume.
This native kernel code, in order to be able to resume from a
laptop/desktop being suspended to disk, which means that after you issue
the pm-hibernate command in the case of pm-utils, this actually copies the
entire contents of ram to your swap partition and then totally powers off
your computer. The next time you restart your computer it is *meant* to
resume from where you left off after going through the boot-up rotine.
This does not happen unless you use an initramfs. It just plain ignores
the saved suspended image and does a new boot instead.
There is at this time only one solution to this, that I found on Arch
linux's wiki, that does not require the use of intitramfs.
It is a program called TuxOnIce. This patches the kernel code and adds an
advanced power management option to the kernel. This is not a complete
removal of the swsusp code but an additional option. There is an option
to make it the default power manager. If you wish, you can still use
swsusp by passing a parameter in the configuration files after you have
installed the hibernation script.
The only issue at this stage for using TuxOnIce is that the patch for
using the vanilla kernel, such as what we use is only for the 3.16.X
series.
I have at this stage downgraded to see if it would work, though I do still
have my 3.17.6 kernel in grub.cfg as well.
I tried the latest code for tuxonice-kernel-tuxonice-3.17 from their
git-hub repository, but it has not yet been completed and does not
compile.
The main developer of TuxOnIce has been too busy with other projects to do
much work on it, however I noticed that the committ for the new kernel
source was made in November, so he is doing something.
With using this patched kernel, I now find that the comupter does indeed
resume from the state it was in when I issued the hibernate command. It
totaly powers off with no flashing lights on the laptop and resumes from a
cold boot.
It was ONLY the suspend-to-disk option of pm-utils and also systemd's
hibernate that failed. The suspend worked fine as it went through and
suspended the session, leaving both the light next to the powerbutton and
the other activity light on the laptop flashing. When I did push the
power button the computer would wake up and allow me to continue from
where I left off.
I have been on far too many sites to actually post all of the findings as
I closed many of the tabs without actually book marking them.
For those who are interested, you can view the TuxOnIce webpage's features
and even download the patches from there:
http://tuxonice.nigelcunningham.com.au/features
I have no idea how many people are using laptops or for that matter
desktops that want to have hibernate work correctly, without the need to
build an initramfs image to solve the resume-from-disk issue.
When the patch is updated for the current kernel series it may, if others
also agree, be a good idea to actually include this in the book. Though I
suspect that as this is really an advanced option that it may well be
considered to be up to the user to investigate. I am more than willing to
do the work, I just do not want to start making a page only to have it
deemed not wanted/needed.
I am trying to work my way through the many lines of code that the patch
for the 3.16.X series makes changes to, and see if I can actually get a
working patch, but I really would rather let the developer do this as this
is the core of the operating system and even if I do manage to get a
working patch I really would not have any idea if I have inadvertently
messed something up in the process.
The instructions that I followed for setting up the user-space
hibernate-script can be found on Arch wiki here:
https://wiki.archlinux.org/index.php/Suspending_to_Disk_with_hibernate-script
also here:
https://wiki.archlinux.org/index.php/Uswsusp (This is one place where Arch
mention that the suspend/hibernate functionality of pm-utils has been
deprecated back in 2013).
This is not actually limited to systemd for a change. I thought that it
was from my initial investigation. I will however say that other distro's
wanted to be able to use systemd's hybrid-sleep and hibernate without the
need to use an initramfs, but this was shot down by Pottering, who is
currently working for Red Hat, as he does not want it to be supported.
Regards,
Christopher.
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page