OS crashing and forcing logout

New to Rocky Linux, after running Centos for many years. I’m thinking that ultimately this is going to be some sort of hardware error, but I don’t know where to look to confirm this, or if there are any software settings that can be changed to resolve this issue.

Basically the issue is that on occasion my system will freeze for a second or two, then bring me back to the login screen. No rhyme or reason behind it, all system temperatures are good, nothing overheating. When I go to log back in, everything I had open is “lost”. Almost as though I logged out myself and logged back in.

When I was running Centos, the system would crash and actually reboot. I initially thought a video card issue because right before the crash I would see the text-based “boot” screen, so I purchased a new card and the problem seemed to go away for a while. Then I discovered that Centos was no longer a viable version and found Rocky Linux, which I like better than Centos. :slight_smile: I’ve also replaced both of my physical hard drives (installed Rocky Linux new on one drive, using the second drive as data storage), and I now have an SSD “boot” drive, with two data drives.

It seems as though Rocky Linux handles the “crash” a little better, but it’s still crashing maybe once a week. The most recent time it happened was yesterday and I wasn’t even using the machine. I had it at the lock screen and when I went to unlock, I had to completely log in again.

Any suggestions?

I’d take a look journalctl to see if anything stands out. If something is crashing and forcing you back to GDM (the login manager), there’s usually a reason and the journal will typically have an error and a stack trace. Depending on what the error is, that’s when investigating /var/log/messages and dmesg may come into play.

sudo journalctl -b -1
Plays the previous boot messages “-2” the one before that and so forth.