Hi All. I’m having an issue that I am hoping I can get some help with.
I have been using linux on this particular laptop for over a year now, and for the past 6 or so months (right around the time I upgraded to Plasma 6, but I think it is just a coincidence) about 50% of the time, when I update all my packages via package manager, the whole system freezes. Like, hard freezes. Waiting any amount of time won’t get me out of it. I have to hold the power button to power it down. I can’t use ctrl+alt+F3 or whatever to get another TTY. Mouse doesn’t move. Nothing works.
It originally happened with OpenSUSE Tumbleweed on btrfs. I thought maybe it was btrfs, so I reinstalled with ext4. Same issue. I tried Manjaro. Same issue. I tried EndeavourOS (wasn’t really expecting different behavior at this point). Same issue.
Now I am thinking, what could cause an issue like this? Well, a package manager update just is a ton of file I/O operations, right? Could I have bad RAM and that is getting written to disk? Well, I did a memtest today and it came back perfect. So now I’m thinking it might be the SSD, but I’m not even sure how to check that.
Does anyone have any ideas of what might be going on or what I should do to fix it or debug it?
That’s probably an I/O issue. I’ve had this problem when my BTRFS mount options were misconfigured. Also happened to ext4, but that couldn’t do snapshots before apt operations so it didn’t really need to lock the FS as much.
You can try reducing the I/O priority of intensive processes and filesystems and double check your mount options. If they’re optimised for HDDs, your SSD performance may suffer.
In my experience, Windows does a lot better when the system is overloaded with I/O or runs out of RAM out of the box. You can tweak most of those options out of the way, if you know where to look.
Specifically for BTRFS, fsync operations are quite intensive. You can use tools like
eatmydata
to reduce the impact by temporarily disabling fsync for a specific command (may not work with PackageKit software). Tweaking the BTRFS layout to exclude directories like /var/log and /var/run can also help reduce the impact of things like snapshots and deduplicated operations.