Hibernate - Can it work with a Swapfile - If Yes, how? (LXQt only)

First, I’m aware that Ubuntu discourages the use of Hibernate, and promotes swap files instead of swap partitions.

But in many professional/work cases, the indefinite storage time of Hibernate is needed.

I’ve set up Hibernate on my my machine (quite involved) using a swap partition. It works perfectly.

But setting up Hibernate never worked using a swap file.

Questions:
is it even possible to get Hibernate functioning using a swap file?
if yes, how?
or is a swap partition the only way?

I’ve done a writeup of how to do it with a swap partition, but as the upload function here does not work (at least for me), I’ll wait for feedback.

Cheers.

3 Likes

I would try again with the upload…

Thomas just made a fix to CSP you got messaged about (a link you couldn’t see), that hopefully fixed the upload issue too.

Thanks for writing up hibernate with swap partition; I’m looking forward to reading it :slight_smile:

3 Likes

OK, several replies coming:
No one has jumped in to answer my questions about Hibernate and swap file. That alone is interesting. No success stories?

Anyway, in my following post, I’ll list my recipe for Hibernating with a swap partition. You’re free to publish/criticize/demolish in any way you like, :slight_smile:

Personally I’ve not used hibernate in years… It made sense with laptops, but I only use desktops these days, so don’t care about the minor power loss of suspend.

Jeeeezzz!!!.
I just tried entering my way of setting up Hibernating.
It was a DISASTER!!

This site apparently interprets normal text characters in a post (like “<>”/…) as HTML attributes and maim the entries.
How should I code my entries here, please? Is 7-bit ASCII allowed?

I see no reason why you couldn’t include any amount of text, including HTML. Admittedly, HTML will get interpreted and rendered accordingly:

some text bold

but with code blocks, this is a non-issue:

<html>
<body>
some text<b>bold</b>
</body>
</html>
2 Likes

Well, as an example, inserting this (plain) text:
(inserted as image as nothing else works)

Results in:

4: verify the partition with sudo lsblk and sudo blkid and copy the UUID of /dev/sda3 ()

Not really nice.

Seems you don’t do field work. Always nice with a cozy office :slight_smile:

Here it is with code blocks:

4: verify the partition with sudo lsblk and sudo blkid and copy the UUID of /dev/sda3 (<yourswapUUID>)

To disable the syntax highlighting (which it tries to automatically figure out), just specify “text” as the format:

4: verify the partition with sudo lsblk and sudo blkid and copy the UUID of /dev/sda3 (<yourswapUUID>)

Just so you’re clear, that is this:

```text
4: verify the partition with sudo lsblk and sudo blkid and copy the UUID of /dev/sda3 (<yourswapUUID>)
```

Quite frankly, that’s uninteresting.

The problem seems to be, that this forum partially interprets uploaded text as code. In this case <>.
This is a first compared to other forums I visit.

To me (as user), text is text, and I expect it to be treated as such.

That’s the way Discourse works. I can understand your feelings, but it’s the way it is. You can always complain to Jeff Atwood (good luck!) :slight_smile: Frankly, the fact that it works this way is a benefit, in my mind.

Thank You for the feedback. I’ve no idea who Jeff Atwood is and don’t really want to know.

I’ll upload my inputs as .PDF in the future.

If exporting and uploading a PDF is faster and easier than surrounding your paste in six backticks, more power to you.

P.S. Jeff Atwood created Discourse, and Stack Exchange, too. Both of them employ a Markdown-ish markup language.

1 Like

Getting back at the original issue, I should mention there’s a topic on the Ubuntu Discourse discussing the situation with hibernation. From what I can gather, it’s simply not something that will work the same way no matter what in all situations. Bummer, I know. AFAIK we still have it in the shutdown menu and it should realistically be removed.

1 Like

@wxl
VERY interesting, Thank You.
The thread supports my supposition that Hibernate only works with a swap partition.

Or made to work?

You might have noticed my comment there that between the linked Arch docs and the AskUbuntu question that the conclusion to draw is that hibernate cannot be made to work well with all hardware in the same way. In that sense, it seems like there’s no way to make it work for everyone. At least not without some intense kernel work and lots of testing over a huge range of hardware. I’d like to say it’s doable but I can’t see an easy solution.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.