Auto restart when doing work

Today couple of hours ago i installed the OS on my desktop.
I did all the system update and restart.

Then, I was logged in on my gmail account and doing some google drive stuff and suddenly my pc restarted (screen went off and then on like restart, the cpu was running)

Any reason why it happened?
And how to stop it next time from happening?

I have a computer that do the same thing. It turns out to be a faulty CPU. But try running a RAM test on your computer, it might be faulty RAM.

Memtest86 will take time as i have 2 rams * 8GB.

So if the there is no error then cpu issue??

For me it was that - Do also check the log app if it happens again.

As you have a desktop (not laptop with battery) could it have been a Power glitch maybe?
Is it consistently happening or a one-off?

Not constant, once in a while like once in month or twice in a month.
From past 3-4 month when i was in Zorin before, then i switched to another distro and today i installed zorin again.

I should have asked at that time.

In 1 Ram is writtern 2400C17-8G and another 2400C15-8G.
So, does the C17 and C15 can create the conflict?

How to check the log?
Btw, i am a linux noob.

Well aren't you in for a treat. I'll try my best and welcome to the world of Linux :slight_smile:

  • be sure to pay attention and not share any sensitive information while copy/pasting*
  1. open a terminal using ctrl-alt-t

  2. Update the system by typing the following:
    apt update
    apt upgrade
    If this actually upgrades or installs anything, make note of it and return the output within reason(aka. if it's not 18 pages of output)
    If nothing was outdated or no errors were produced from the above move onto the following:

  3. system reboots and events are stored for easy reference, so in the terminal type last reboot
    This will provide you the recorded instances of the machine rebooting
    for example on my system a single line of output is:
    reboot system boot 5.11.0-27-generi Thu Aug 19 14:53 - 16:10 (14+01:17)
    But you should see more than just that, find one that relates to one of the magical reboots and save the line.
    TIP: You can copy things from term using ctrl-shift-c, paste using ctrl-shift-v
    TIP: You can do this using gedit... it's like notepad for gnome(gnu-linux)

  4. Next is to ensure you're not suffering from a kernel panic or other such major failure. Share the output of the following:
    sudo grep -iE "error|panic|kernel" /var/log/syslog

  5. as well it may be of benefit to get all of these logs together with the timestamps provide the output of sudo journalctl -b | grep -i -E 'kernel panic|systemd-shutdown' || grep -i -E 'reboot|systemd.*Started' /var/log/syslog /var/log/syslog.1 | tac | awk '/^--/ {count++;if(count==2)exit} {print}' | tac | grep -i -E 'kernel|panic|error' | sed 's/^\(.\{15\}\)/\1 /'

Don't fret over the syntax of the last one, I didn't write it but am also trying to not overwhelm you with these things, if you are interested in learning any of these commands man <<command>> is your friend. press q to exit the man page eg. man awk

1 Like

I copy pasted all of them in the text editor.
The 4th one is a massive output, thousands of lines.

How can i share the file to u?
No option to attach file.

in the terminal do this:
sudo grep -iE "error|panic|kernel" /var/log/syslog | nc termbin.com 9999
and share the link it gives you.

1 Like

Here -
https://termbin.com/7k8w8

1 Like

Well isn't that pretty :slight_smile: well done

so I see here:

Apr  4 09:41:05 desktop kernel: [ 1897.433235] loop0: detected capacity change from 0 to 8
Apr  4 09:41:21 desktop gnome-software[2272]: Error cancelling ongoing pull at /var/lib/flatpak/repo/tmp/flatpak-cache-LF8Y21: Operation was cancelled
Apr  4 09:44:31 desktop kernel: [ 2103.025784] loop0: detected capacity change from 0 to 8
Apr  4 09:44:43 desktop kernel: [ 2115.203152] loop0: detected capacity change from 0 to 8
Apr  4 09:46:09 desktop kernel: [ 2200.582926] rfkill: input handler enabled
Apr  4 09:46:09 desktop gnome-shell[1744]: gnome-shell: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.
Apr  4 09:46:09 desktop systemd[1]: Stopping Tool to automatically collect and submit kernel crash signatures...
Apr  4 09:47:00 desktop systemd[1]: Started udev Kernel Device Manager.
Apr  4 09:47:00 desktop kernel: [    0.000000] Linux version 5.15.0-69-generic (buildd@lcy02-amd64-071) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #76~20.04.1-Ubuntu SMP Mon Mar 20 15:54:19 UTC 2023 (Ubuntu 5.15.0-69.76~20.04.1-generic 5.15.87)
Apr  4 09:47:00 desktop kernel: [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-69-generic root=UUID=ac9c9cd3-f44b-4fa2-9f0c-b8300870a24a ro quiet splash vt.handoff=7

you have a loop0 device that's certainly misbehaving, I don't know more than what's listed about the loop0 device.

moving forward from there I suspected that it might be drive related, and found some gold:

Apr  4 17:30:52 desktop kernel: [  596.511998] blk_update_request: I/O error, dev sr0, sector 7 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Apr  4 17:30:52 desktop kernel: [  596.512003] Buffer I/O error on dev sr0, logical block 7, async page read
Apr  4 17:33:16 desktop kernel: [  739.645746] loop0: detected capacity change from 0 to 8
Apr  4 17:33:22 desktop kernel: [  745.884298] loop0: detected capacity change from 0 to 8
Apr  4 17:37:56 desktop kernel: [ 1020.197959] GPT:Primary header thinks Alt. header is not at the end of the disk.
Apr  4 17:37:56 desktop kernel: [ 1020.197964] GPT:2097151 != 15950591
Apr  4 17:37:56 desktop kernel: [ 1020.197967] GPT:Alternate GPT header not at the end of the disk.
Apr  4 17:37:56 desktop kernel: [ 1020.197968] GPT:2097151 != 15950591
Apr  4 17:37:56 desktop kernel: [ 1020.197970] GPT: Use GNU Parted to correct GPT errors.
Apr  4 17:37:56 desktop kernel: [ 1020.197981]  sdc: sdc1 sdc2 sdc3
Apr  4 17:38:06 desktop kernel: [ 1029.958794] rfkill: input handler enabled
Apr  4 17:38:06 desktop systemd[1]: Stopping Tool to automatically collect and submit kernel crash signatures...
Apr  4 21:33:25 desktop kernel: [    0.000000] Linux version 5.15.0-69-generic (buildd@lcy02-amd64-071) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #76~20.04.1-Ubuntu SMP Mon Mar 20 15:54:19 UTC 2023 (Ubuntu 5.15.0-69.76~20.04.1-generic 5.15.87)
Apr  4 21:33:25 desktop kernel: [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-69-generic root=UUID=ac9c9cd3-f44b-4fa2-9f0c-b8300870a24a ro quiet splash vt.handoff=7

The above indicates that there's a problem with either the partition tables on sdc, or the drive itself might have gone south. How old is the hard-drive? are you aware of any damage to the drive?

  • if you have any secondary drives, usb, internal or otherwise I'd suggest unplugging them and reporting back the results. If you cannot remove sdc(given it's "c" indicates it's not primary), you will need to test the drive:
sudo fsck /dev/sdc

This will scan your drive and prompt you to fix any errors on disk, I'd strongly suggest you review the output; if it's void of personal info, sharing it here wouldn't hurt

after which I would suggest using a tool like parted or gparted to try and repair the drive; however that's where my experience stops. I can say I would use gparted because it's got a gui. From within there you "should" be able to go through the menu or right click the device to get some options.

If not, patience as hopefully another community member can both confirm my conclusion and with any luck offer further input on resolving the problem on sdc.

1 Like

Well the drive is 6 years old Samsung ssd.
As it is an internal drive, no taking in out in past so i guess no external damage.

If u don't mind, i will come back tomorrow(right now it is 11 pm at night here) and unplug the seconday hdd which is 7-8 years old and report the test back to u the way i did moments ago.

Tomorrow i will unplug the 2nd drive and do - "error|panic|kernel" /var/log/syslog | nc termbin.com 9999
And i will submit to u.

Take your time, have a good night.

Yea. Signing out.

Could be that the CPU isn't fully seated and thermal expansion / contraction is causing an intermittent connection on some CPU pins. If that's the case, re-seating the CPU should do it.

It could be that the CPU is overheating... and you may not even know it. If your heat sink isn't seated properly you likely won't even hear your fans spinning up; if your thermal sensor is malfunctioning the computer has no way of knowing if the CPU is overheating; or if you're using a heat-pipe heatsink and the heatpipe has failed it could be that it's not removing enough heat from the CPU. Testing and reseating the heatsink is called for in this case. Test it by removing the heatsink, dipping the base of it in hot water, then feeling the heat pipe or fins... heat should rapidly move from the hot water to the heat pipe or fins. If it doesn't, replace the heat sink. When reseating the heat sink, I recommend diamond heat sink compound, as diamonds have extremely high heat transfer capability.

It could also be that thermal creep has caused some of the connections to the socket for the CPU to start opening... when they first started using lead-free solder, this was a bigger issue. A reflow of the solder is called for in this case. I won't go into that, as it entails baking your motherboard at a very precise temperature and the risk of ruining your motherboard is high.

It could be a power supply issue... if your power supply's capacitors are starting to go bad, they could be sending bad power to the motherboard. This was more of an issue about 15 years ago when a bunch of cheap counterfeit capacitors made their way into the market. Check all the caps on your motherboard and in your power supply... if you see the top puffed up, you know it's going bad. Unsoldering the old cap and soldering in new is called for in this case.

It could be a power supply issue... if you've added a card, drive or peripheral lately, you could be pushing up against the capacity of your power supply. Buying a higher-capacity power supply is called for in this case.

It could be a power supply issue... if your wall power is dirty, that could be making its way through the power supply's filtering and corrupting data, leading to spontaneous reboots. A power supply that filters better, or an always-on UPS (one that inverts the power from the battery into a sine wave at all times, not just when the power is out; and separately charges the battery from wall power) is called for in this instance... the battery, then, absorbs any wall power glitches.

It could be bad memory... a memory check is called for in this instance.

It could be a programming glitch... if you've got a driver installed that's not exactly the one you need, it could cause this. Updating the system is called for in this case.

It could be lack of sufficient memory... if you've got only a small amount of memory and the default 2GB of swap and you attempt to run a lot of programs, the kernel could panic. Installing no-hang is called for, as well as getting more memory, as well as setting up a larger swap space.

nohang/focal,now 0.2.0-1~oibaf~f all
sophisticated low memory handler for Linux

sudo add-apt-repository ppa:oibaf/test
sudo apt update
sudo apt install nohang
sudo systemctl enable --now nohang-desktop.service

It could be bad sectors on your drive... if the data's not saved accurately, your data could be getting corrupted, or the computer glitches after the drive times out after attempting to read or write data to a bad sector. Checking all the drives for errors is called for in this case.

He quite literally shared the entire system logs in comment above for review; if you'd have a look there I'm sure like me you'll see there's no indication of driver issues, overheating, or memory issues. Did you see something in these logs I've missed?