Linux Troubleshooting Guide: Fix the Most Common Problems
Troubleshooting has always been one of the most frustrating aspects of computer ownership. Due to the practically infinite number of potential problems, it would be utterly impossible to write a how-to guide to fix all of them, but in this article we are going to address some of the most common problems and then present more generalized guidelines that will help you troubleshoot your own problems in an emergency.
Repair the GUI System
One of the most common problems in Linux is a broken GUI configuration. The X Windowing System (Xorg) is the most common GUI system in use on Linux systems today. Unlike the Windows GUI, (which is practically inextricable from the rest of the operating system) Xorg is simply a program that runs on top of the base Linux system. Because of this, it can be easily repaired.
The X Windowing System uses a file called xorg.conf to maintain the GUI configuration. It contains information about your graphics hardware, the driver it uses, (in the case of NVIDIA or ATI devices) your available screen resolutions, and even settings for your input devices. The best way to avoid any problem is prevention, so you should always have at least one backup copy of important files like xorg.conf and be sure to save a copy of the current working version each you make any modifications to it.
Don't panic if the worst happens and you find yourself without a working xorg.conf. The base system is probably still operational and it is possible to carry on without the GUI, although some distros might complain a bit if Xorg refuses to start. Many modern distros (like Mandriva, Ubuntu, and others) have a safe mode or recovery mode that provides a root-level command prompt. From there, you have access to the bash-friendly utilities and tools that are essential to fix your system. Even better than that, your distro probably has a special tool which can repair or completely regenerate xorg.conf.

During our test where we deliberately deleted xorg.conf, Ubuntu 9.04's GUI continued to work, much to our amazement. (we rebooted several times to make sure it was not a glitch) If that is not the case for you, Ubuntu's Recovery Mode has an automated tool called xfix that will try to rebuild xorg.conf without any additional interaction. Once xfix has worked, you will have the option of resuming normal boot. This tool worked perfectly for us on the first try by replacing the xorg.conf file that we erased from our test machine.
For Mandriva, boot into “Safe mode” and run “Xfdrake”.This tool will walk you through the process of rebuilding xorg.conf in a step-by-step interface where you are able to select configuration options from a list. With some knowledge of your hardware and a little luck, this should get you running again.

Reinstall GRUB
Many Linux users have dual-boot systems, and this works very well for the most part. Since the Windows bootloader is not very friendly to non-Microsoft operating systems, most distros use a different bootloader called GRUB (Grand Unified Bootloader) that is capable of working with multiple operating systems, including Windows.
Since Windows installations tend to degrade over time, (a phenomenon known as “Windows Rot”) it is inevitable that you must reinstall Windows at some point. If you are using GRUB or a different bootloader, your other operating systems will be inaccessible (but still intact) after a Windows reinstall since the Windows setup process will replace the bootloader without asking you. Although it is possible to reinstall GRUB manually (often through a Live CD distro) there is a tool called Super GRUB that can make the process much easier.

Super GRUB is an extension of the regular GRUB bootloader. It comes as an ISO image which may be burned to a CD or placed on a USB stick. (an ideal use for any old low-capacity USB flash drives you may still have) Although it is absolutely tiny by today's standards (weighing in at a little over 4 MB) Super GRUB works like a miniature operating system with several pre-defined tools that can handle many boot-related processes. Super GRUB can automatically find your operating system partitions and use this data to reinstall and configure conventional GRUB. Super GRUB can even even do the exact opposite: remove conventional GRUB and restore the normal Windows bootloader.

To use Super GRUB, download and prepare the ISO image for the media format you want to use. Once you have done that, reboot the computer with the Super GRUB disc or USB stick. You will be greeted with a conventional GRUB boot menu with the Super GRUB option on it. You will soon see the Super GRUB main menu. To attempt automated repair, run the “GRUB => MBR & !Linux! (1) Auto ;-) “ option. If that fails, you have the option of repairing GRUB manually. Our only criticism of Super GRUB is that its menus can be rather hard to understand, but it works very well in spite of that.