Recover from system crash

What is the proper way to recover from a system crash or lockup? In the past I would just press the power button and restart. I’ve discovered that that’s probably not the best way.

I’ve now learned to press and hold [Alt] + [SysRq] while pressing R - E - I - S - U - B. I then boot to a live mode from USB and run sudo fsck /dev/sda2 (sda2 is the / partition) in a terminal.

Is there anything else I should do to make sure my file system is clean and everything is back as it should be?

Jim

That pretty much covers it.
I’m not even sure the manual fsck run is required, the “S” of “REISUB” is synchronizing your data to the disks so you shouldn’t be left with an unclean filesystem.

There are other reasons for a crash or lockup. Did Apport create a crash log? Look in /var/crash.

There are also system logs.

https://help.ubuntu.com/community/LinuxLogFiles

https://help.ubuntu.com/community/DebuggingSystemCrash

Thanks. I've just experienced another crash. I have Mate 16.04.1 in /sda2 as my main system. I also have Mate 16.10 in /sda6 as my "development/play around with" version. I was trying to install ChessMaster 8000 in Windows XP running in VMWare Player (in Mate 16.10) when VMWare player crashed.

I was able to use Alt+SysRq+REISUB to reboot the system, but I thought "I've had enough of this for today. I'm going back to 16.04 and get on the Internet."

When I tried to boot into 16.04 I got the following error message (sorry about the flash)

REISUB didn't work, so I pressed the power button and booted into recovery mode in Mate 16.04. I ran fsck and grub updater. Everything now seems fine.

It seems a little odd that a program crashing in Mate 16.10 on sda6 would effect my Mate 16.04 installation on sda2. Any thoughts?

Jim

Hi Jim,

I am not sure if it will help but you could try running "dpkg" (a network cable connection is required) per the update guide?:

It is weird. Weirder though is that your system is crashing in the first place. Can you provide the output of:

inxi -CG

Cheers

I can't find inxi -CG. Any thoughts?

Weird, inxi is installed by default on Ubuntu 16.04 +, you should just have to open a terminal and type in the command.

I'm sorry. Dopey me. I thought I was looking for a log file. Here's the results:

If I don’t remember wrong (which is always possible), the last line “kernel panic - not syncing : VFS: unable to mount root fs on unknown-block(0,8)” indicates that kernel couldn’t figure out the partitions (the last numbers 0,8 are error codes).

While you are in 16.04 and looking around anyway, could you please take a look at /etc/fstab and tell us if partitions are listed using /dev/sd* or UUID notation?

My point being: using UUID is recommended, they will point to the right partition even if the /dev/sda* assignments get messed up for some reason and make sure you can boot. It won’t explain the crash when using 16.10 and VMWare, though, so that’s a different matter.

Here's the contents of fstab:

Well, that is just as it should be and makes sure you can boot even if the /dev/sd* assignments would for some weird reason shift. 16.04 is booting and working ok now?

Hi @Jim007,

according to your pic:

your GPU (Nvidia) drivers aren't loading correctly!. :confused: Did you install any Nvidia drivers?. :smiley:

I haven't installed the Nvidia drivers, I'm still running on the Nouveau. And I think this may be the problem. I think it's my video that's crashing when my screen locks up.

In the past, when my screen locked up (at that time I didn't know about REISUB) I knew no alternative but to push the power button. After a couple of these, my system got to the point where it was unbootable, even in recovery mode. I did some research on how I could boot to a live USB and figure out which blocks had not been written back to the system, but it just seemed simpler to reinstall.

In the past, when I've tried the Nvidia drivers, I didn't realize that I needed to make sure that nomodeset was still in grub when I rebooted. I think that the Nvidia drivers may be the solution.

16.04 is working great, and since I've learned about REISUB, the occasional crash is no longer wrecking my system. As I was telling Wolfman, I think we've narrowed the problem down to the video drivers.

I've now installed the Nvidia drivers. I think that now its trying to load both Nvidia and nouveau drivers. Is that what the following means?

Hi Jim,

what version of the Nvidia drivers did you install and what method did you use?.

See also:

I started out by installing the driver from Additional Drivers (I think the version was 304.132) in my Mate 16.10 partition. This worked well other than the error message when I ran inxi -CG. So I decided to install the nvidia driver, using the same method, in my Mate 16.04 partition. When I rebooted I couldn't get back into the system using any method I knew. I went back into 16.10 and did some research on how to mount my system using a live USB.

Going back to 16.04 via live USB, I mounted everything and used the following method:

After rebooting I could get back into my 16.04 partition, so I used the same method to install nvidia-375 on my 16.10 partition. Everything seems to be running well on both 16.04 and 16.10 except that part of the top menu bar is cut off.

Here's the results now for inxi -CG for both 16.04 and 16.10. Note that 16.04 gives my screen resolution at 77 Hz, while 16.10 gives my screen resolution at 0 Hz. Not sure what that means.

I have an Nvidia NV44A (GeForce 6200) video card. Evidently, it is not completely compatible with the nouveau drivers. When I run inxi -CG, I get an error message that the drivers are not loading correctly.

The recommended driver from Additional Drivers is the Nvidia 304.132. There is, however, a more recent driver on nvidia's website. Nvidia 304.134. I have installed both of these drivers with the same result. After installing and rebooting I cannot get back into my system. The screen freezes at the Nvidia logo.

I thought that the problem was with xserver-xorg, so I removed that. It didn't help, and I was now locked out of my system with no video drivers. So I reinstalled xorg from a TTY in recovery mode. Now when I go to Additional Drivers it tells me that I have manually installed drivers, so I can't select anything from there.

The interesting thing is that I have the exact same driver installed on my 16.10 Mate partition, and it seems to be doing fine. I had wanted to keep 16.04 LTS as my main system, and use the 16.10 partition for experimenting with new software.

However, it seems that the only way to get the Nvidia drivers to work might be to upgrade to 16.10.

Now that 16.04.2 is out, I'm thinking it may just be easier to do a reinstall. However, I'm afraid I may still be faced with a driver conflict.

Hi Jim,

can you get into recovery mode, if you can, run “dpkg” per my earlier suggestion and see if that helps (see the update guide). :smiley:

Failing that, you can try running the following command (as one command):

sudo apt-get remove nvidia-304 && sudo apt-get update && sudo apt-get install nvidia-304

You can also try (the following will/should install any missing dependencies):

sudo apt-get update && sudo apt-get dist-upgrade -f