hibernation and sleep problems

Hello,

I have a super computer which is: very noisy and surely energy-hungry. I would like it to go to sleep automatically, but I have some concerns:

For automatic standby, it seems that some applications like Kdenlive block it. I can force it using:

systemctl suspend -i But suddenly it's no longer automatic!

When my computer is in standby, I also noticed that it did not cut the USB ports, for example a fan which is plugged into a USB port continues to run even if the computer is in standby!

How can these two problems be resolved?

Then comes the problem of hibernation, which works alternatively … I tried to go to the command line to see what was happening, and I have this message:

@localhost: ~> systemctl hibernate
Failed to hibernate system via logind: Not enough swap space for hibernation

So, obviously you need a swap partition the same size as the RAM, is it possible to work around this?

Thank you !

Have a look at /etc/tlp.conf

Then comes the problem of hibernation, which works alternatively … I tried to go to the command line to see what was happening, and I have this message:

@localhost: ~> systemctl hibernate
Failed to hibernate system via logind: Not enough swap space for hibernation

So, obviously you need a swap partition the same size as the RAM, is it possible to work around this?

Thank you !

On that last question: Best would be to have at least 1.5 times the size of your RAM as swap partition. But, you can also create a swapfile IIRC.

But I doubt that using file swap instead of partition swap will work with hibernation. After all, the hibernation partition is mentioned in your kernel parameters list in Grub as (on a system here):

resume=/dev/disk/by-uuid/212ea772-7bec-4bee-85b5-786f7a810356

I doubt there is a way there to mention a file in a yet to be mounted file system of a still unknown type. But Grub may be celeverer then I assume.

Have a look at /etc/tlp.conf

@localhost:~> cat /etc/tlp.conf
cat: /etc/tlp.conf: No such file or directory


I have already heard of TCL but I did not understand everything. Do I have to install something? And why isn’t there this default function?

It may be intentional, my notebook have USB ports that retain power in standby and can be used to charge external devices. This can be configured in BIOS.

So, obviously you need a swap partition the same size as the RAM, is it possible to work around this?

You need to store memory content somewhere so you not only need swap partition of sufficient size, but you need to have enough free space when you hibernate. If your swap partition is full, it does not matter how large it is. systemd checks that current Active(anon) size in /proc/meminfo fits into available swap space. So it is by far not as simple as “size of RAM”.

If you insist, you can set SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1 in environment of logind to bypass memory check.