Open Source Software and Linux

Sep 11 2008   12:36AM GMT

Troubleshooot your Linux boot process with GRUB



Posted by: Xjlittle
Tags:
/boot
/root
grub
grub.conf
Linux
menu.lst

Red Hat and subsequently Fedora and CentOS use the the GRUB (Grand Unified Boot Loader) to initialize the kernel and boot into Linux. I’m going to look at some of the common error messages possible when booting Linux and how to edit the GRUB boot loader to test and fix the errors.

GRUB has 6 basic editing commands:

b=boot the currently listed operating system
d=delete the current line
e=edit the current line
a=append a parameter to GRUB
o=create an empty line underneath the current line
O=create an empty line above the current line

These are the commands with which I will initially be working to access the grub configuration file.

After you boot to the GRUB menu screen highlight the line the Linux version that you want to edit. I like to use e so that I can choose which line that I want to edit.

On Red Hat and it’s derivatives you will usually see three lines at this point:

root
kernel
initrd

While any of the three could need editing to pass a parameter to the kernel you will want to use the kernel line. Highlight this line and press e to edit. Move to the end of the line to add a parameter. The kernel has many parameters that you can add here. I will use some of the more commonly used.

Booting into a different runlevel is probably one of the most common tasks of a Linux administrator. The Red Hat kernel has 7 parameters that you can use to boot to the runlevel that you want. These are 1, single (or s), emergency, 2, 3, 4, or 5. If you add single or s to the end of this line you will boot into single user mode. If you boot into runlevel 0 or 6 you will either halt or reboot your machine.

Another common area that not only administrators but users as well find themselves requiring is the VGA setting. Occasionally on updating a video driver or for various other reasons your machine may continue booting but only showing a black screen without any output. A possible way to overcome this so that you can see the output and at least get to runlevel 3 is vga=ask.

Some other commonly used parameters are selinux=[0|1] where 0 disables selinux, acpi=[force|off|noirq|ht|strict] and mem=n[KMG].

The ACPI option controls parameters that the Advanced Configuration and Power Interface (ACPI) subsystem can use. This is the main option for the Advanced Configuration and Power Interface (ACPI). The values are:
force: Force ACPI to be enabled. Can be used to override the kernel configuration option that disabled it.
off: Disable ACPI. Can be used to override the kernel configuration option that enabled it.
noirq: Prevent ACPI from being used for IRQ routing.
ht: Run only enough of the ACPI layer to enable HyperThreading on processors that are capable of it.
strict: Make the ACPI layer be less tolerant of platforms that are not fully compliant with the ACPI specification.

The mem option forces a certain amount of memory used by the kernel. When
used with the memmap= option, physical address space collisions can be avoided. Without the memmap= option, this option could cause PCI devices to be placed at addresses that belong to unused RAM. n specifies the amount of memory to force and is measured in units of kilobytes (K), megabytes (M), or gigabytes (G).

That covers some basics kernel parameters, how to access and edit them. You will find these most useful generally on a new install or after adding new hardware that is either not detected or acting properly.

If you want to see more on the various kernel options and parameters install the kernel-doc package. The documentation can then be found under /usr/share/doc/kernel-doc-2.6.18/Documentation on recent Red Hat and CentOS versions.

Next post I’ll get into some of the error messages that are common when you Linux machine refuses to boot.

-j

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: