sections in this module City College of San Francisco - CS260A
Unix/Linux System Administration

Module: StartupShutdown II
module list

Common Problems

In this section we will discuss a few special problems during the boot process. The purpose here will be to gain access to the system so that you can fix it. This usually involves reducing the level of functionality of the system when it is booted to circumvent the problem in order to gain access. We will discuss some of the more common problems beginning with the most functional and finishing with the least functional unable to boot at all case. Before we discuss individual problems, however, we need to cover how to boot a single-user shell.

Booting to single-user mode

Although we discussed this briefly in the last section, we need to review the steps for booting to single-user mode. Single-user mode is needed for performing maintenance operations that may be needed if the system is not booting properly. Briefly, this type of maintenance is performed by:

To modify the boot process to boot to single-user state you must

If you have configured your system to password-protect the single-user shell as suggested in the previous section, you will be asked to enter the root password to get to single-user mode.

Booting to single-user mode is required for many of the configuration changes that are required to solve the specific problems in this section.

Note: instead of the word single you can substitute a number 1-5 which indicates the runlevel to go to. Thus, 1 and single are the same.

Problem: the system boots, but the GUI won't start

This indicates that Xorg has not been configured correctly for your monitor and/or your graphics card. The most common reason for this problem is that you have very new hardware and a new installation of linux. Assuming your linux version has a driver available that can talk to your graphics chipset, the issue boils down to getting (or creating) a configuration file for Xorg with the information it needs.

Traditionally, the Xorg configuration file was named xorg.conf and was usually found in /etc/X11. (There are about 15 places it 'could' be: see xorg.conf(5), but this is the most common one.) However, recent releases did not include this file, and let Xorg figure out the configuration when it started. This makes sense, as the first step in a 'fix' of a misconfiguration is to force Xorg to regenerate it, and if it can generate the correct configuration parameters, why does it need a configuration file?

In any case, the first step is to see if there is an xorg.conf file. If there is, you may just try to regenerate it, replace the file, and try it. If this doesn't work, about the only thing you can do is to search the Internet.

First, get access to a shell. The easiest way to do this is to use CNTL-ALT-FN to change to a virtual console (remember, FN is functionkey-N, where N is 2-5). Then login and become root. Next, disable the window manager using initctl stop prefdm. Then you can work to resolve the problem using the text console. When you have a new xorg.conf file to install, you simply run startx to start the X server. 

# Xorg -configure

Once you find an xorg.conf file that seems to work, drop it into /etc/X11 and restart prefdm using initctl.

Note: The xorg.conf file contains parameters for clocking and driving your video display and graphics chipset. You should not tweek these parameters yourself unless you know what you are doing, as incorrect clocking of your devices can damage them.

Note: the next section contains commands that will be easier to understand after we cover the Filesystems topic. You may want to review this section later.

Problem: I can boot the system, but I've forgotten the root password!

This is the a common problem. It requires starting the system in single-user mode, then running the passwd program after you get a single-user shell. This changes the root password.

IF you have added the sulogin program as a safeguard to the single-user shell you have a bigger problem. The simplest (but not the safest) solution is to force your single-user shell to run instead of init when the system boots. The safer solution is to use a rescue disk to change  /etc/sysconfig/init to not use the sushell program first, then reboot the system. See the instructions for the use of a rescue disk in the procedure about the forgotten grub password.

To force your single-user shell to run, follow this procedure:

mount -o remount,rw  /dev/sdaX

Alternate procedure to circumventing sulogin if the root password is forgotten:

This requires the use of a rescue disk. Note: modifying the filesystem from a rescue disk may cause SELinux to relabel your entire filesystem the next time you boot. This is a time-consuming operation. Be prepared.

or

Problem: I need to be able to boot to single-user mode, and I've forgotten grub's password.

This problem is similar to the previous one. You must use the rescue disk to locate your grub.conf file. Then comment out the password line, remove the rescue disk, and reboot. Now follow the instructions about booting to single-user mode. (Of course if you are using the sulogin program you should fix this at the same time!)

Problem: The system won't boot at all. It's just dead!

This may be due to a hardware failure. In that case, I hope you have backed up your data. In any case, the boot loader in the master boot record (MBR) has been destroyed. Unfortunately, since the main partition table is in the same sector as the boot loader, the viability of your system is in serious question. (If you have lost your main parition table, you are pretty well sunk unless you have saved a copy of the disk parameters somewhere.)

The only solution here is to try to re-install grub into your MBR. Begin by using the rescue disk to mount your data under the alternate location (/mnt/sysimage) as indicated previously. If this is successful, it means that your partition table is intact(!) and your chances of success are high. 

Next, invoke grub and ask grub to locate your configuration file. In the example below, we assume you are using a separate /boot parition. If you do not have a separate /boot partition, search for /boot/grub/grub.conf instead:

grub> find /grub/grub.conf

grub will report the partition(s) that contain a grub.conf file. (There will only be one if you have a single distro installed. Otherwise you will have to select one.) The output will describe the device and partition in grub's format like (hd0,4). (This is the fifth partition on the first IDE-type disk.)

set grub's root to the device specification that contains the configuration file using the command 

grub> root (hd0,4)

(in the case of grub.conf being on (hd0,4).) Now you are ready to install grub. Use the command setup, giving it the device of your boot disk. Given the device spec for grub.conf above, this would be (hd0):

grub> setup (hd0)

grub will noisily install itself in your MBR using the data from your root device. Now you are ready to reboot. Exit the single-user shell, remove the rescue disk, and reboot.


Preview question: If you ever shut down a multi-user system you should allow your users to gracefully finish what they are doing. This is accomplished using the shutdown command. Review the man page on shutdown.

Prev This page was made entirely with free software on linux:  
the Mozilla Project
and Openoffice.org      
Next

Copyright 2012 Greg Boyd - All Rights Reserved.