My Ubuntu 20.04.1 LTS PC restarts randomly

My operating system restarts by itself randomly, sometimes it reboots few minutes after boot, it happens 2-3 times and after that it's ok for a month, and I can't find anything suspicious in /var/log/dmesg A guy who was checking my hardware (doing stress tests for 12 hours, but on windows, I didn't give him my SSD with the system) didn't find any hardware issue.

Maybe you can find something and point me, or give me some idea where to look

Here is my /var/log/dmesg file: https://gist.github.com/pmartini/e849b65ffd6ce8ad5c14deed1b2b602a

and journalctl output: https://gist.github.com/pmartini/1e843d0f1de982f53daeaf617fa7767b

lsblk output:

    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0  96,6M  1 loop /snap/core/9804
loop1    7:1    0  29,9M  1 loop /snap/snapd/8790
loop2    7:2    0  55,3M  1 loop /snap/core18/1885
loop3    7:3    0  14,9M  1 loop /snap/ubuntu-mate-welcome/524
loop4    7:4    0    16K  1 loop /snap/software-boutique/54
loop5    7:5    0  97,1M  1 loop /snap/core/9993
loop6    7:6    0  14,9M  1 loop /snap/ubuntu-mate-welcome/539
loop7    7:7    0    55M  1 loop /snap/core18/1880
loop8    7:8    0 197,5M  1 loop /snap/viber-unofficial/37
loop9    7:9    0  30,3M  1 loop /snap/snapd/9279
sda      8:0    0 111,8G  0 disk 
├─sda1   8:1    0 107,1G  0 part /
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0   4,7G  0 part [SWAP]
sr0     11:0    1  1024M  0 rom  

fdisl -l output: https://gist.github.com/pmartini/acceb0fac6c20631b4eb8c1044b724e9

grep sda5 /etc/fstab outut: # swap was on /dev/sda5 during installation

grep sda5 /proc/mounts doesn't show any output


Solution 1:

For the next person with this problem...

I recently built a new Ubuntu 20.04.2 system, using AMD Ryzen 3700x with an NVidia GP108 graphics card, and it has had a similar behavior -- mostly works fine, but occasionally spontaneously reboots with nothing much in the system logs. It doesn't seem related to what I'm doing at the time - sometimes reboots when I'm just typing email, other times when the computer is sitting idle waiting for the timer to trigger suspend. Not a heat issue either, running below 30C with several fans installed.

I suspected a hardware issue. The system is a Ryzen 3700x, with 16GB of DDR3200 memory. As part of building, I had set the BIOS to use DDR3200. Today, I changed that BIOS setting back to Auto, letting the MB decide what memory setting to use. System has been stable for many hours now, when before I would have expected at least a few spontaneous reboots.

So, suggestion -- try changing your memory settings; the system might be a few percent slower, but that's better than rebooting at random.

Solution 2:

It looks like I found the source of the problem, I ran memtest86 before logging into Unbuntu, and it was stopping at 40% each time I ran it. I played with RAM sticks ( I have three) for a while and found that one of them is broken (when I keep only this stick inserted the system didn't load at all and pc speaker was beeping). I bought 2 RAM sticks from a list recommended by a motherboard manufacturer and everything seems ok now.