this post was submitted on 04 Jun 2024
16 points (83.3% liked)

Linux

48328 readers
626 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] bjoern_tantau@swg-empire.de 3 points 5 months ago (1 children)

I mean, the swap file just has to be large enough to accommodate your system RAM. Everything in zram is already in system RAM, just compressed.

[–] theshatterstone54@feddit.uk 1 points 5 months ago (1 children)

Okay, my concern was that if I have, say 1.4G in zram, that would unpack to, say, 2G, which, when added to 7G, would go over the 8G limit. I was worried that RAM might be saved in its uncompressed manner, when saved in the swapfile for hibernation.

[–] gnuhaut@lemmy.ml 1 points 5 months ago

I think the hibernation image is compressed by default (all of it). Also, some of what is in your RAM is just files from disk. I think those don't need to be saved into the hibernation image, since they're already on disk. For example, libc.so.6 would definitely be in RAM and in use, but it's also on disk, so no need to save it during hibernate.

So the hibernation image should be substantially smaller than your used RAM.