So here’s my situation:

I’m on Fedora 40 on a laptop and I’ve recently decided to add a Hibernate option to my own logout/powermenu script that I use. The script executes systemctl hibernate but there’s a problem. It didn’t seem to work. When I ran the above command in terminal, I got an error stating that there’s not enough suitable swap space for that. Turns out that I’m using swap-to-zram hence why Hibernate doesn’t work.

So, I decided to ask ChatGPT and it recommended creating a swapfile. I can do that no problem.

The thing is, if I’m using swap-to-zram, I concluded it is likely that if I’m making use of that swap-to-zram all the time, I will probably need a larger swapfile for the hibernation.

So I asked our AI overlords if there’s a risk in that. It said there isn’t any real risk, other than increased drive wear-and-tear and potential performance issues.

Dear Linux users of Lemmy, are there any issues or concerns I should be aware of before attempting something like this (running multiple types of swap simultaneously, excess swapfile space, etc.)? Thank you.

Edit: Not sure how relevant it is, seeing as I’m not asking about swap partitions, but I’ll mention using BTRFS, just in case. And no, I don’t know anything about it, I just know it has cool features I’m yet to start learning about.

  • dingdongitsabear
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    7 months ago

    you need a swap file, a swap subvolume, or a swap partition that’s RAM + 50%, on account of zram. then you need systemd scripts that disable zram and enable swap on suspend and do the reverse on resume. also, you need some selinux tuning to allow you to write to said file. you have a detailed howto in Fedora Magazine.

    stop using bullshitgpt.

    edit: here’s the article.