You are not logged in.

#1 2020-12-01 11:08:21

1d0mene0
Member
Registered: 2020-12-01
Posts: 5

Random freezes with LVM, encryption and swap

Hi there,

I've tried everything I could, but I can't find a real solution to this issue. I've already searched through the forum and I've found a couple of interesting threads, but nobody seems to have fixed it for good, so here I am, hoping somebody has a silver bullet, I guess...

I'm running archlinux with the latest available LTS kernel 5.4.79-1-lts (initially I thought that a "bleeding edge" kernel was the cause of my freezes, but I was wrong!). The issue is likely to happen when the RAM (8 GB) is  almost full, but I noticed it's quite random. Sometimes the system freezes just for a few seconds, other times it freezes for good and all I can do is press the power off button of my laptop. The first kind of freeze is acceptable to me, but the second is not because I usually lose all of my (unsaved) work and frankly it's quite frustrating. Also, checking my system with journalctl, I don't see anything suspicious and it just seems a random bug!

At the beginning, I was convinced the cause was just the dimension of my swapfile, so I enlarged it as recommended for hibernation (size of RAM + 4 additional GB), but I've found that freezes do not necessarily depend upon the dimension of my swapfile, as the system still keeps freezing at least twice a day... even though the swapfile is almost empty!

The only workaround I was able to find is to completely disable the swap (as someone suggested in other threads), this in my experience totally prevents random freezes, but of course it's not a desirable solution because:

1. I can't use hibernation
2. When the RAM is almost full or so, some applications suddenly crash

Does anyone have any idea on how to solve this nightmare? Does avoiding LVM and encryption altogether my only option ? Perhaps I should try with a swap partition instead of a swap file?

Thanks!

Last edited by 1d0mene0 (2020-12-01 16:38:44)

Offline

#2 2020-12-06 18:12:06

1d0mene0
Member
Registered: 2020-12-01
Posts: 5

Re: Random freezes with LVM, encryption and swap

It turns out that I was overly optimistic thinking that with no swap the laptop will not freeze. I've noticed it still does, IMO less frequently than before (with swap file active), but the fact that is less frequent is may be due to the fact that I'm more aware (and wary) of my RAM consumption right now and I try not to saturate it... I don't know. I honestly still don't really understand why with a swap file active, it freezes that much, but that's it! Does anyone have any idea on how to mitigate it (except adding more RAM, which of course will work 100%)?

Last edited by 1d0mene0 (2020-12-06 18:13:47)

Offline

#3 2020-12-06 18:24:28

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 590

Re: Random freezes with LVM, encryption and swap

Full RAM is a problem, when RAM is full and there's swap OOM kicks in and heavy swapping along with it.
Heavy swapping is...horrible, so the slowdown is really obvious.

...

In any case this is not random, it's expected, get more RAM of learn to manage your system more efficiently.
This haves nothing to do with LVM+LUKS+SWAP.


My reposSome snippets

Heisenberg might have been here.

Offline

#4 2020-12-06 20:09:37

1d0mene0
Member
Registered: 2020-12-01
Posts: 5

Re: Random freezes with LVM, encryption and swap

The thing is that it mostly does not simply "slow down", it freezes for good! I've already waited countless minutes from time to time, hoping the system will unfreeze at some point, but to no avail; in fact, I'm almost always forced to just press the power button.

Offline

#5 2020-12-07 04:39:56

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: Random freezes with LVM, encryption and swap

The issue has been raised before such as https://bbs.archlinux.org/viewtopic.php?id=233086 with no solution apart from moving swap off the encrypted lvm.

Offline

#6 2020-12-09 22:06:09

1d0mene0
Member
Registered: 2020-12-01
Posts: 5

Re: Random freezes with LVM, encryption and swap

loqs wrote:

The issue has been raised before such as https://bbs.archlinux.org/viewtopic.php?id=233086 with no solution apart from moving swap off the encrypted lvm.

Exactly! I was hoping that in the meanwhile something had changed. I was wrong, clearly. Anyway, what's the point of having an uncrypted swap partition if you have the entire disk encrypted with lvm?

Offline

#7 2020-12-09 22:14:10

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: Random freezes with LVM, encryption and swap

As a work around you could still encrypt the swap partition but place it directly on a block device.

Offline

#8 2021-01-08 17:58:49

1d0mene0
Member
Registered: 2020-12-01
Posts: 5

Re: Random freezes with LVM, encryption and swap

loqs wrote:

As a work around you could still encrypt the swap partition but place it directly on a block device.

Thanks. I apologize for the late reply... but yes, your workaround should work! Anyway, long story short, I simply decided to add 8 GB RAM to my laptop (=16 GB now) and never ever had an issue since! Clearly my workflow needed more RAM in order to be smooth and no swap partition could really spare me from that!

Offline

Board footer

Powered by FluxBB