You are not logged in.
Pages: 1
Hi,
I want to add swap to be able to use hibernation. I'm thinking of using a swap file for better flexibility. And in the Automated section I see that the suggested solution is zram-generator. But if I understand it correctly it creates a disk in RAM, and there's probably no way to make it use a file on a disk. Which probably makes it unfit for hibernation. Also, there's the following issue on the systemd-swap repository. There seems to be some way, but I'm not sure I'll be able to make it work. And I'm not sure it's worth it. Should I just follow the manual instructions?
On a side note, I have 16 Gb of RAM and it seems kind of wasteful to use that much space on disk (SSD) for swap as well. But well, if it's needed for hibernation to work reliably, I'd rather do that.
Offline
You'll have to reserve the hibernation space no matter what, but see https://wiki.archlinux.org/index.php/Po … /file_size
The hibernation image is by default compressed anyway, https://www.kernel.org/doc/html/latest/ … wsusp.html
Offline
Well, and now it sounds... Is anybody using hibernation? Well, somebody always does. I mean, now it sounds risky.
If you touch anything on disk between suspend and resume…
…kiss your data goodbye.
What if I accidentally boot into another os (windows) between suspend and resume? Which will most likely not touch the linux partitions. Does that qualifies as touching the disk?
Q:
Is this true that if I have a mounted filesystem on a USB device and I suspend to disk, I can lose data unless the filesystem has been mounted with “sync”?
A:That’s right … if you disconnect that device, you may lose data. In fact, even with “-o sync” you can lose data if your programs have information in buffers they haven’t written out to a disk you disconnect, or if you disconnect before the device finished saving data you wrote.
Do I lose data on all the drives, or only on the USB? Well, I don't really understand how it works, that's probably why I ask stupid questions.
And considering all this, using a swap partition sounds like a safer/easier option, probably the one I should start with.
Offline
Does that qualifies as touching the disk?
"most likely not" but there can be weird (transient) impacts on your hardware (wfi doesn't work or so)
Windows in particular has the bigger issue that is discussed in the 3rd link in my signature.
only on the USB
This goes for any reason that might make you unplug an unsynced filesystem.
a swap partition sounds like a safer/easier
The quoted concerns are regardless on where you store the hibernation image, ie. a swap partition has no benefits here at all.
Read the story about the bear here: https://bbs.archlinux.org/viewtopic.php … 4#p1960554
Offline
Pages: 1