I am trying to fix hibernate on my desktop. I am running a x99 motherboard, Ubuntu 16.04, kernel 4.8.0-41-generic, and nvidia-370.
I can successfully hibernate by manually setting /sys/power/disk
to shutdown
instead of the default platform
and manually telling the kernel to hibernate. I learned how to do this from https://help.ubuntu.com/community/PowerManagement/Hibernate.
sudo -s
echo shutdown > /sys/power/disk
echo disk > /sys/power/state
This works nearly perfectly. There are some slight graphical issues with the task bar that go away when you click on it. Also, my nvidia settings get slightly reset. I can live with that. The other versions of nvidia driver I have tried crash hard.
When the value is platform
my PC will not shut all the way down. I have to hard power off. However, when I restart the state is resumed correctly. Only when I manually force it hibernate and manual set the value shutdown
does my PC shut off and state is resumed.
Since this worked, tried to make my /sys/power/disk
default to shutdown
instead of platform. I followed the advice of https://askubuntu.com/a/837334/154184 but the value seems stay platform
.
jophde@pyre:~$ sudo cat /etc/pm/config.d/hibernate_mode
HIBERNATE_MODE="shutdown"
I believe my file permissions are correct since there are the same as the defaults file.
jophde@pyre:~$ sudo ls -lah /etc/pm/config.d/hibernate_mode
-rw-r--r-- 1 root root 26 Mar 22 02:32 /etc/pm/config.d/hibernate_mode
jophde@pyre:~$ sudo ls -lah /usr/lib/pm-utils/defaults
-rw-r--r-- 1 root root 2.0K Mar 22 01:52 /usr/lib/pm-utils/defaults
The code that gets run when you run sudo pm-hibernate
and reads in these values is /usr/lib/pm-utils/pm-functions
. The part that sets the values from the defaults and user configs seems a bit hacky so maybe there is a bug there?
for cfg in "${PM_UTILS_ETCDIR}"/config.d/*[!~] \
"${PM_UTILS_ETCDIR}/${STASHNAME}.config.d"/*[!~]; do
[ -f "$cfg" ] || continue
# Ugly, I know. The goal here is to allow multiple files in
# /etc/pm/config.d declare these variables and have those
# declarations add together instead of the last one overwriting
# all the others.
[ "$SUSPEND_MODULES" ] && REAL_SUSPEND_MODULES="$SUSPEND_MODULES"
[ "$HOOK_BLACKLIST" ] && REAL_HOOK_BLACKLIST="$HOOK_BLACKLIST"
[ "$ADD_PARAMETERS" ] && REAL_ADD_PARAMETERS="$ADD_PARAMETERS"
[ "$DROP_PARAMETERS" ] && REAL_DROP_PARAMETERS="$DROP_PARAMETERS"
set -a
. "${cfg}"
SUSPEND_MODULES="$REAL_SUSPEND_MODULES $SUSPEND_MODULES"
HOOK_BLACKLIST="$REAL_HOOK_BLACKLIST $HOOK_BLACKLIST"
ADD_PARAMETERS="$REAL_ADD_PARAMETERS $ADD_PARAMETERS"
DROP_PARAMETERS="$REAL_DROP_PARAMETERS $DROP_PARAMETERS"
set +a
done
I don't have any other configs in /etc/pm/config.d/
and I did not modify
/usr/lib/pm-utils/defaults
.
How do I get HIBERNATE_MODE="shutdown"
to work with Ubuntu Hibernate menu item and pm-hibernate
?