1

I have Asus laptop and I have Debian 9 with Cinammon desktop, dual boot with windows 10 and Nvidia graphic card.

I have really strange problem :

when I hibernate my Laptop by clicking menu->quit->Hibernate , it is OK , it turned off and after I push power button it turned on and my session come back and there is no problem.

But when i close the LID,the laptop turned off, and after turning it on , the monitor is NOT on !

that is not black screen , the monitor is OFF.

Once while monitor was OFF I entered my user name and password and pressed Enter and pressed ctrl+alt+T and typed : sudo reboot and then typed my password and after hitting Enter button my laptop rebooted :D

So all of my hardware is OK and OS runs successfully,

the real problem is being monitor off after hibernating by closing Lid

I have tried these links and many other links I have found in google but they did not work... :

step-by-step-how-to-get-hibernate-working-for-linux-ubuntu-11-04-mint-11

debian-8-jessie-laptop-stops-working-after-closing-the-laptop-lid

  • 1
    See Suspend on lid close : debian docs. – GAD3R Jul 18 '18 at 14:27
  • 1
    @GAD3R Thanks a bunch , but this solution create a service which after closing lid, first , make system suspended and after 5 minutes it turn the system on and hibernate it. isn't a solution that hibernate immidiately ? and not suspend first ? Thank you. – Parsa Jul 18 '18 at 16:29
1

I struggled with a similar issue in Debian 9, installed on a Lenovo G40-30 Laptop. I went into Hibernate/Sleep and trying to initiate again the screen didn't show up although everything seemed working.

The solution is actually quite simple. It seems Linux OSs, in particular Debian and Ubuntu need at least a 4+GB swap partition for Hibernate/Sleep to work properly. If you installed with "default" configuration it will create a Swap the same size of your actual RAM (in practice a little less). So if you have a laptop with less or equal to 4 Gb RAM and installed "default" configuration, you are probably trying to solve this issue.

Swap allocation in Linux work in two ways:

1) in the form of a SWAP PARTITION in your hardrive.

2) in the form of a SWAP FILE.

YOU CAN CREATE THE SWAP FILE AS FOLLOWS:

sudo swapon --show 

shows if you have enabled the swap option. If not look up how to do this.

sudo fallocate -l 1G /swapfile

sets the size of the swap you add to 1Gb, change to the value you need.

sudo chmod 600 /swapfile        # sets the file to be owned by root     
sudo mkswap /swapfile           # mkswap tool to allocate swap in the file
sudo swapon /swapfile           # activate the swap 
sudo nano /etc/fstab            # open the file to make changes permanent

Add the line /swapfile swap swap defaults 0 0 to the file /etc/fstab:

sudo swapon --show              # show if its working
sudo free -h                    # show Memory and Swap 

IF YOU WANT TO UNDO CHANGES JUST:

sudo swapoff -v /swapfile

remove the line from /etc/fstab file: /swapfile swap swap defaults 0 0

sudo rm /swapfile         # remove the swap file

SWAP SIZES ACCORDING TO RAM:

I can indicate the following table with some recommended SWAP sizes according to your RAM. Last 3 columns are SWAP spaces:

    RAM       No hibernation    With Hibernation   Maximum

    1GB              1GB                 2GB        2GB
    2GB              1GB                 3GB        4GB
    3GB              2GB                 5GB        6GB
    4GB              2GB                 6GB        8GB
    5GB              2GB                 7GB       10GB
    6GB              2GB                 8GB       12GB
    8GB              3GB                11GB       16GB
   12GB              3GB                15GB       24GB
   16GB              4GB                20GB       32GB
   24GB              5GB                29GB       48GB
   32GB              6GB                38GB       64GB
   64GB              8GB                72GB      128GB
  128GB             11GB               139GB      256GB
  256GB             16GB               272GB      512GB
  512GB             23GB               535GB        1TB
    1TB             32GB              1056GB        2TB
    2TB             46GB              2094GB        4TB
    4TB             64GB              4160GB        8TB
    8TB             91GB              8283GB       16TB

MORE INFORMATION:

you can find thorough information on recommended SWAP sizes according to your RAM in the following link:

https://askubuntu.com/questions/594054/how-much-swap-should-i-take-for-1gb-to-8tb-of-ram-on-14-04-or-higher

Credit is due for the table I added here.

  • 1
    I have 8 GB swap and 8 GB ram – Parsa May 31 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.