Linux Linux help

Crashes, Hangs and Reboots

1. What is a Crash?

A crash occurs when a misbehaving program or driver shutdowns Linux completely and displays an error message. On Linux this is usually a a kernel panic or other fatal message. Sometimes the faulty program will just stop responding and either hangs or shuts it self down and display the desktop. Fortunately, Linux is very stable, and this will rarely happen.

2. What is a Hang?

Hanging, freezing or unresponsiveness can be caused by a program using too much CPU time (see Task Manager) and not allowing Linux or other programs to run. Bad hardware or drivers can also cause freezing as the hardware is either incorrectly installed, or the drivers has bugs or some other problem.

3. What is a Reboot?

A reboot is when a serious problem occurs and the computer unexpectedly shuts down and restarts. This is usually caused by hardware problems such as overheating CPU or component or not enough power to the system. Power spikes and surges can also cause reboots as well, a spike protection device or a UPS (Uninterruptable Power Supply) can fix those problems. To force a reboot, run sudo reboot or sudo shutdown -r -t 0.

4. How do I troubleshoot crashes, hangs and reboots?

When you can back into your system, load up the System Log Viewer from the System Tools and check the dmesg, boot.log and syslog logs for any recent errors and warnings. These can point you to potential problems on your system. If using the command line, you can view the logs in /var/log, e.g. more /var/log/dmesg, /var/log/syslog, /var/log/boot.log or /var/log/kern.log.

9. How do I repair my Linux system?

a). You can check and repair disks using the fsck (filesystem check) command.
b) To remove and purge a bad package use the apt-get purge command.
c) To update the package cache and check for broken dependancies use apt-get check.
d) To fix boot or start up issues see trouble-shooting GRUB.
e) Make and use a Live Linux DVD so that you can boot up to a working Linux environment.

11. How do I get to the Recovery Console?

Press the Shift key when bootig and will show the GRUB menu, there you select you normal boot option, a recovery linux option and memtest (memory test) tools.
Press ESC at the GRUB prompt. Enter e to edit the boot and select the line starting with kernel and add the following after it rw init=/bin/bash to enable read/write and start a bash shell. Then press Enter and b to boot.

Grub menu

12. How do I restart a service?

In Ubuntu, you can restart a service, by using sudo systemctl restart servicename. A list of services can be view by running systemctl to list all services. Use option 'list-units --type=service --state=running' to list all running services.. A list of services can be found in /etc/systemd/system, /etc/init.d , /etc/rc*.d folders.
To stop a server, use the sudo systemctl stop servicename and to disable or enable a service enter sudo systemctl disable servicename or sudo systemctl enable servicename to re-enable it again. Also, check /etc/init.d folder for any old service startup scripts.

13. How do I add, remove or disable devices?

Some devices can cause trouble, you can view devices (also known as modules), using the lsmod command. New devices or modules can be added with insmod, or modprobe and removed with the rmmod command.

14. Command reports missing libraries?

If a program a reports a missing library, you can refresh the library cache with the ldconfig command. Otherwise you will need to install it using apt, yum, dpkg or rpm.
To list available modules for PHP use the PHP -m command (use grep to look for specific ones). For python modules, run pip list.For perl modules, run cpan -l.

Using Disks and CD Recording