Ubuntu – Computer can not enter suspend mode, freezes instead (ubuntu 18)

18.04suspend

My problem is similar to this one: Ubuntu 18.04, my PC doesn't enter sleep mode. I will try to provide a bit more details.

When I try to suspend the computer (by closing the lid, pushing the power button or using keyboard shortcut), it has a good chance of not working. Sometimes it works fine, but it is maybe one time out of ten. Here is what happens when it does not work:

  1. First, the displays turn off. My screen is black, but the computer does not enter sleep mode (the fans are turning, the LEDs are on…)
  2. When I move the mouse or press a key, the screens turns on again. I can see the battery icon and the "application" icon (top right and top left of screen), but can not see the task bar. My wallpaper is also missing, replaced by only purple. Cursor moves but clicks have no effects.
  3. Ctrl-Alt-F1 prompts the login screen, but I am back to the previous situation after entering my credentials.
  4. I could enter a terminal session (ctrl-alt-F3 for instance) and log in. I then tried to use the "shutdown" or "reboot" commands, but both output the message "Failed to power off/reboot system via logind: there's already a shutdown or sleep operation in progress"
  5. Using shutdown -c does not seem to work on this "sleep operation in progress"
  6. When I try "sudo shutdown -f", the terminal freezes (does not ask for password) and I have to maintain power button to shut down. It actually does it even if I only type "sudo".
  7. If I try "startx", the screen turns black for 30 seconds more or less then comes back to the terminal session.

Eventually the only way I have to reboot is to maintain power button to force shutdown.

My configuration : MSI GS60 with Ubuntu 18.04 64bit, Intel® Core™ i7-4720HQ CPU @ 2.60GHz × 8, Intel® Haswell Mobile (graphic chipset). I also have a Nvidia 970M, but I deactivated it (I only use it on windows). I have a dual boot with windows 10. edit: 16G RAM

Thanks in advance for any solution one could provide 🙂

Best Answer

After formatting and setting a bigger swap, the problem is solved. I used the same size as my RAM, 16G.