I can't make my Ubuntu 18.04 hibernate (I tried use both swap file and swap partion, nothing works)
Look at your /etc/initramfs-tools/conf.d/resume
file. It should contain the UUID of your swap partition, like so:
RESUME=UUID=071f8b0e-8e16-4f4d-90ff-a4ae9cc56e2b
# use your own correct UUID
To identify the correct UUID to use:
sudo blkid
# to display your UUIDs
Look for a line similar to this:
/dev/sda8: UUID="071f8b0e-8e16-4f4d-90ff-a4ae9cc56e2b" TYPE="swap" PARTUUID="d042d9f3-dfe7-4ba9-bbc8-efe6413e7fa4"
# your UUID will be different
Then perform:
sudo update-initramfs -c
# to create a fresh initramfs image file
reboot
# to reboot the computer
Now retest hibernate.
Related videos on Youtube
Comments
-
mathmd over 1 year
As the title suggest.
I've already tried
sudo pm-hibernate
,sudo systemctl hibernate
,sudo s2disk
all of them did nothing and just freeze on input in the terminal, exceptsudo systemctl hibernate
which seems to shutdown the system instantly but fail to resume after start the machine back up again.I had 8 Gb RAM, 9 Gb Swap partition, when I first tried and I've already added
resume
parameter in/etc/default/grub
. And failed after I tried to hibernate as I described above.After that I tried use swap file instead of swap partition to hibernate by creating a 5 Gb swap file (I heard that I only need at least half the size of my RAM) and then add the parameter
resume_offset
to theGRUB_CMDLINE_LINUX_DEFAULT
the same way as I did withresume
.I also add the following to
/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
[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
and also edit the following (changing from
yes
tono
in theResultActive
both section) in/var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
:[Disable hibernate by default in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=no [Disable hibernate by default in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit ResultActive=no
Note that when I use
sudo pm-hibernate
I only havepm-utils
installed. And when I usedsudo s2disk
I uninstallpm-utils
before reinstalluswsusp
then run the command like thissudo dpkg-reconfigure -pmedium uswsusp
before
sudo s2disk
and then again nothings happenedwhat did I do wrong? I don't know what else I should try.
-
mathmd about 6 yearsOk, sorry. I'm a bit desperate.
-
abu_bua over 5 yearsTake a look at this page: wiki.ubuntu.com/DebuggingKernelHibernate and wiki.ubuntu.com/Kernel/Reference/S4#Machine_Boot_Failure
-
abu_bua over 5 yearsThis blog is also an excellent one: 01.org/blogs/rzhang/2015/best-practice-debug-linux-suspend/…
-
-
mathmd about 6 yearsOk now there's
RESUME=UUID=592d80c6-6112-4602-95f7-47f80d67e0e8
, which is the UUID of my swap partition in my/etc/initramfs-tools/conf.d/resume
Then I ransudo update-initramfs -c -k 4.15.0-20-generic
then reboot and test hibernation withsudo systemctl hibernate
(withuswsusp
andpm-utils
purged) ..well it didn't hibernate but it turns into the Screen Lock instead -
Boris Hamanov about 6 years@AidenBhe did hibernate work in 17.10? From your update-initramfs command, you're running kernel 4.15.0-20-generic, yes? Hibernate is normally disabled in Ubuntu for operational reliability issues, and may never work on your computer. However, have you checked for a BIOS update?
-
Boris Hamanov about 6 years@AidenBhe you may have to edit /etc/default/grub and find the
quiet splash
line and add something likeresume=/dev/sda8
orresume=UUID=592d80c6-6112-4602-95f7-47f80d67e0e8
and thensudo update-grub
, reboot and retest. -
mathmd about 6 yearsThank you for a quick reply. I've already done that here's the lines in
/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=592d80c6-6112-4602-95f7-47f80d67e0e8"
GRUB_CMDLINE_LINUX=""
and yes4.15.0-20-generic
is my kernel version. I haven't thought about flashing BIOS though I'll try that and let you know! -
mathmd about 6 yearsBy "window manager" did you mean from GNOME? Because from my desktop I don't have any Hibernation Button in the status menu when I recently installed Ubuntu 18.04. But I did add a GNOME extension to have the button in the status menu though and it did the same thing when I
sudo systemctl hibernate
-
mathmd about 6 yearsAnd also I just returned to Ubuntu recently so I haven't use 17.04 or 17.10 before.
-
Adriano dos Santos Fernandes almost 6 yearsIt works for me, but the wired network is always down after restore, and I cant make it up until restart.