Power saving for laptops: Difference between revisions
Line 97: | Line 97: | ||
And restart system or execute: sudo systemctl restart systemd-logind.service | And restart system or execute: sudo systemctl restart systemd-logind.service | ||
(https://unix.stackexchange.com/questions/125832/no-hibernate-option-in-power-manager-on-mint-16-mate) | (https://unix.stackexchange.com/questions/125832/no-hibernate-option-in-power-manager-on-mint-16-mate) | ||
---- | |||
If you have change your hard disk or the partition table, then your computer will save a session, but it won't be able to resume it upon power up, acting as if it was rebooted rather than hibernated. | |||
In this case, you have to inform initramfs-tools about the correct partition uuid. First of all, take note of the id of your swap partition with | |||
<pre> | |||
$ ls /dev/disk/by-uuid -la | |||
</pre> | |||
Then, edit the file /etc/initramfs-tools/conf.d/resume accordingly. | |||
Finally update initramfs with | |||
<pre> | |||
# update-initramfs -u | |||
</pre> | |||
It it still doesn't work, try to specify the restore partition to Grub too. However, it should not be necessary. | |||
Edit the file /etc/default/grub specifying the UUID of your swap partition: | |||
<pre> | |||
GRUB_CMDLINE_LINUX="resume=UUID=6098d082-4654-4840-8937-7337d14b2c5d other-option=value" | |||
</pre> | |||
or simply use the device | |||
<pre> | |||
GRUB_CMDLINE_LINUX="resume=/dev/sda1 other-option=value" | |||
</pre> | |||
Don't forget to update Grub. | |||
<pre> | |||
# update-grub | |||
</pre> | |||
Reboot, and try to hibernate: | |||
<pre> | |||
# pm-hibernate | |||
</pre> | |||
[https://unix.stackexchange.com/questions/8827/hibernate-to-disk-not-restoring-but-suspend-to-ram-is-working https://unix.stackexchange.com/questions/8827/hibernate-to-disk-not-restoring-but-suspend-to-ram-is-working] | |||
=== Other files=== | === Other files=== |
Revision as of 11:24, 15 July 2018
sudo apt-get install powertop indicator-power upower laptop-mode-tools
then run the following
gksu lmt-config-gui ;for laptop mode tools sudo powertop --calibrate ;note will run for some time
turn off bluetooth, check power settings for suspends
1). Enter the following in terminal: sudo gedit /etc/rc.local
2). Enter: rfkill block bluetooth
Suspend and hibernate
Suspend saves everthing to RAM, hibernate to disk. Suspend wakes up faster, Hibernate saves your batteries more. Hybrid modes try to combine the best of both worlds.
Ubuntu guide how to hibernate my computer and test it
Archlinux page on suspend and hibernate
good Archlinux thread on troubleshooting
Hibernate
ways to hibernate
pm-hibernate
is a collection of scripts that solve a lot of strange hibernation problems and bugs (see the man page). They should not be needed any more
systemctl hibernate
is the way you should be hibernating [1]
needs trying
systemd-sleep
apparently a disaster.
Uswsusp
A collection of suspend tools:
s2ram, s2disk, s2both
[5] NB not tried this yet.
swapping
You can create a swap file or use a swap partition. It makes a difference if the file / partition is encrypted or not. It makes a difference if your swap is encrypted or not. a good general article on creating files or partitions NB. apparently for some people the solution is to create a swap file (haven't tried this yet)
swapon -s
will tell you if your swap is running or not.
swap files
edits to enable hibernation
Edit this file: /var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
eg.: sudo gedit /var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
Add this content:
[Re-enable hibernate by default in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes [Re-enable hibernate by default in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate ResultActive=yes
This will add hibernate option in menu. But if you want to hibernate, when LID will close, then execute this (this will enable hibernation when LID is closed):
sudo sed -i 's/#HandleLidSwitch=suspend/HandleLidSwitch=hibernate/g' /etc/systemd/logind.conf
And restart system or execute: sudo systemctl restart systemd-logind.service (https://unix.stackexchange.com/questions/125832/no-hibernate-option-in-power-manager-on-mint-16-mate)
If you have change your hard disk or the partition table, then your computer will save a session, but it won't be able to resume it upon power up, acting as if it was rebooted rather than hibernated.
In this case, you have to inform initramfs-tools about the correct partition uuid. First of all, take note of the id of your swap partition with
$ ls /dev/disk/by-uuid -la
Then, edit the file /etc/initramfs-tools/conf.d/resume accordingly.
Finally update initramfs with
# update-initramfs -u
It it still doesn't work, try to specify the restore partition to Grub too. However, it should not be necessary.
Edit the file /etc/default/grub specifying the UUID of your swap partition:
GRUB_CMDLINE_LINUX="resume=UUID=6098d082-4654-4840-8937-7337d14b2c5d other-option=value"
or simply use the device
GRUB_CMDLINE_LINUX="resume=/dev/sda1 other-option=value"
Don't forget to update Grub.
# update-grub
Reboot, and try to hibernate:
# pm-hibernate
Other files
/sys/power/resume
/sys/power/resume_offset
/sys/power/reserverd_size