How do I set up hibernate and sleep to work correctly?

Hello,
I am running:

  • OpenMandriva Lx version: ROME 25.03
  • Desktop environment: KDE Plasma Version: 6.3.3; KDE Frameworks Version: 6.11.0
  • Description of the issue: Whenever I try to put the system to sleep, OpenMandriva just freezes until I force the system off. Additionally, I can’t find any options for hibernate. All I’m able to do is shutdown and restart. I’m rather new to Linux, and very new to OpenMandriva.
  • Relevant informations (hardware involved, software version, logs or output…): Here is all my hardware and OS info:
    Qt Version: 6.8.2
    Kernel Version: 6.14.0-desktop-0.rc6.2omv2590 (64-bit)
    Graphics Platform: X11
    Processors: 4 × AMD Ryzen 3 3200U with Radeon Vega Mobile Gfx
    Memory: 5.7 GiB of RAM
    Graphics Processor: AMD Radeon Vega 3 Graphics
    Manufacturer: MOTILE
    Product Name: M141

I appreciate any help that anyone may be able to provide.

Hibernate is not an option, most likely because you did create a swap partition larger than your amount of RAM during the installation. To be sure, lets see the output of

lsblk -ao path,label,uuid,fstype

The output was:
PATH LABEL UUID FSTYPE
/dev/loop0
/dev/loop1
/dev/loop2
/dev/loop3
/dev/loop4
/dev/loop5
/dev/loop6
/dev/loop7
/dev/sda
/dev/sda1 C654-8CB7 vfat
/dev/sda2 89f73bd3-1c63-4790-b916-2111f6e01a4c ext4
/dev/zram0 zram0 bfb25a07-22ca-43a5-b2c9-a7591e866400 swap

  • I don’t think that I did set up swap larger than my RAM, sadly. If I boot into a live environment from USB, could I change the size of the partitions to allow for this?

You have a swap file in RAM with zram. You would need a Swap Partition.

You might be able to resize /dev/sda2 and shrink it down to make room for a swap partition of 7GB. It looks like you have 6GB of RAM. If it is actually 8GB, then you need a 9GB swap partition.

You will most likely have to turn off the zram with

sudo swapoff /dev/zram0

After creating the swap partition, you will have to enable it with

sudo swapon /dev/sda3

Just guessing on that device name, you will have to check it again with

lsblk -ao path,label,uuid,fstype

You will have to disable the zram service

sudo systemctl disable zram.service

I am not positive on the name of that service.

On the other hand, I look online and it is talking about editing GRUB to change it there too. I don’t want to take you in over your head.

I would say start with a fresh install.

Thanks. I’m thinking to just start with a fresh install then. During the installation process, will there automatically be “swap” partition that I can resize, or do I need to manually add my own partition for it? I appreciate your help so much.

I use a desktop, so I have no need to create a partition to hibernate. I have not seen that part of the install. I just know that to hibernate, it has to be larger than the amount of RAM that you have.

In the installed you can setup a sway for hibernation. This is what I did. This gives you sleep and hibernation directly out of the gate. So if you are going to start over this is very easy to get going.

1 Like

Thanks. During installation, do I just need to make a new partition and then later allocate swap to that with the terminal or something? I’m not sure how to add the partition for hibernation.

1 Like

In the partition section of the installer, look for a drop down box. It should say no swap or something like that. (I don’t have the installer in front of me right now) Here you just click on the drop down, and select swap with hibernation.

After installing, when you load OM up, you will see that in the power options you have hibernation and sleep.

I got it all set up correctly now. Sleep and hibernate work well. Thank you so much!

2 Likes

Weird, it was working fine but then it just randomly stopped working. When I try to use both hibernate and sleep, the computer just freezes.

I tried making some changes to the partition sizes from a live environment to try and downsize the Linux partition and increase the size of the swap a little bit, just in case it wasn’t quite big enough. However, I completely broke the operating system, so that was a dumb decision. Ultimately, I decided to just reinstall the entire thing and choose the “swap to file” option so I can have a little bit more adaptability. I really don’t mind the few extra seconds that it will take to sleep and hibernate, versus a dedicated partition for swap. Hopefully this works out without a hitch.

Obviously hibernate and suspend/sleep work differently on different hardware. On my laptop I have no swap other than the zram thingy and suspend works just fine. For a time it did not work under Wayland but now that works also. In other words I install with no swap and suspend/sleep works just fine here.

ASUSLaptop M1605YA with AMD Ryzen 5 7530U with Radeon Graphics (Barcelo)

1 Like

It seemed to work perfectly fine, except that now the only option is for sleep and nothing for hibernate, which is a feature I use all the time. Is there possibly a way I could use the terminal to set up hibernation? I don’t see any way to set it up in the direct settings in OpenMandriva. Thank you so much for your help.
If this is something that I can just google, then I’m happy to do that, but I didn’t know if there was any specific aspects of OpenMandriva that would make the process different.

Hibernate is more dangerous than suspend/sleep. You should ask OM developers.

1 Like

Welcome message

Welcome to OpenMandriva and our forum. This forum is for users of OpenMandriva Linux operating systems.

OpenMandriva forums are mainly users helping other users.

You can talk to our developers at OpenMandriva Chat.

Users with problems need to read How to get better results when posting about problems before reporting any issues or problems. The article is not too long and Do Read.

When a new user has a problem please search the OMLx documentation. OpenMandriva wiki, Forum Resource Guide and the “Search” function of the forum.

If you don’t find what you are looking for, try an Internet search. A lot can be found in the documentation or forum posts for other Linux distributions. If the user finds something written for another distro but has a question, ask in OpenMandriva Chat.

For serious technical problems and package/feature requests please submit a bug report here.

Note: We are a small group. All contributors and developers are unpaid volunteers.
You can make OpenMandriva grow and improve by getting involved.

Any help with testing will be appreciated, whether you are a technical expert or not. The more people and hardware we can get involved, the better we can do OMLx releases and packaging. We also do a lot of testing on virtual machines. Developers tend to use Qemu, most user-level testers use VirtualBox..

Some suggestions that we hope will be useful:

We ask that problems reported in the forum or in a bug report be limited to one problem per thread or report.

We suggest that if your problem reported in the forum or in OM-Chat is not resolved within a few days, please file a proper bug report.

If you have not already done so, scroll through the “Big Warning” at the top of this page and read the information or use the links provided.

Before reporting any problems, read this.

We are simply and respectfully trying to make people aware that as a very small group we are volunteering, without remuneration, our time, expertise, etc, to help you.

Welcome message

Welcome to OpenMandriva and our forum. This forum is for users of OpenMandriva Linux operating systems.

OpenMandriva forums are mainly users helping other users.

You can talk to our developers at OpenMandriva Chat.

Users with problems need to read How to get better results when posting about problems before reporting any issues or problems. The article is not too long and Do Read.

When a new user has a problem please search the OMLx documentation. OpenMandriva wiki, Forum Resource Guide and the “Search” function of the forum.

If you don’t find what you are looking for, try an Internet search. A lot can be found in the documentation or forum posts for other Linux distributions. If the user finds something written for another distro but has a question, ask in OpenMandriva Chat.

For serious technical problems and package/feature requests please submit a bug report here.

Note: We are a small group. All contributors and developers are unpaid volunteers.
You can make OpenMandriva grow and improve by getting involved.

Any help with testing will be appreciated, whether you are a technical expert or not. The more people and hardware we can get involved, the better we can do OMLx releases and packaging. We also do a lot of testing on virtual machines. Developers tend to use Qemu, most user-level testers use VirtualBox..

Some suggestions that we hope will be useful:

We ask that problems reported in the forum or in a bug report be limited to one problem per thread or report.

We suggest that if your problem reported in the forum or in OM-Chat is not resolved within a few days, please file a proper bug report.

If you have not already done so, scroll through the “Big Warning” at the top of this page and read the information or use the links provided.

Before reporting any problems, read this.

We are simply and respectfully trying to make people aware that as a very small group. We are volunteering, without remuneration, our time, expertise, etc, to help you.

1 Like

I should add that I believe the correct command for hibernate is:

systemctl hibernate

In other words suspend and hibernate are controlled by systemd.

1 Like

What is your underlying hardware? What are you running OM on?

If you are going to reinstall, which is most likely the fastest path to a functional system, then I would recommend that you use a swap partition instead of file.

However, if you setup your hibernation and swap via the installer, then your swap size should have been sufficient.

Changing the size of your swap file is not usually the end of the world. But it is a bit more complicated to restore. Kind of outside the scope for what can be conveyed here easily.

1 Like

I appreciate the response. I have now tried setting up the system to have a normal swap, then I tried to reinstall with swap to file. Both times everything worked perfectly fine for a while and then randomly just started freezing the computer whenever I tried it.

When I command “systemctl hibernate”, it says, “Call to hibernate failed, not enough suitable swap space for hibernation available on computer block devices and file system.” I currently have it set as “swap to file.”
When I command “systemctl suspend”, the system instantly freezes, just like when I click the sleep button in the environment.

I wonder if these steps that I found in this article would work correctly on OpenMandriva? How to increase the size of your swapfile | ArcoLinux

My hardware is mentioned at the top of the post, but I’ll place it again here, since you were wondering;

  • OpenMandriva Lx version: ROME 25.03
    Desktop environment: KDE Plasma Version: 6.3.3; KDE Frameworks Version: 6.11.0

  • Relevant informations (hardware involved, software version, logs or output…): Here is all my hardware and OS info:
    Qt Version: 6.8.2
    Kernel Version: 6.14.0-desktop-0.rc6.2omv2590 (64-bit)
    Graphics Platform: X11
    Processors: 4 × AMD Ryzen 3 3200U with Radeon Vega Mobile Gfx
    Memory: 5.7 GiB of RAM
    Graphics Processor: AMD Radeon Vega 3 Graphics
    Manufacturer: MOTILE
    Product Name: M141