GRUB (Unified boot loader) is the basic Linux boot loader.
It has four functions, as follows:
1. Select the operating system (if more than one operating system is installed on the computer).
2. Indicates the partition where the corresponding boot file resides.
3. Locate the kernel.
4. Run the initial memory disk and set the kernel and related modules.
The Grub settings file is
Fedora is in/boot/grub/grub.conf.
Ubuntu is in/boot/grub/menu.lst.
A typical grub setup file in/boot/grub/grub.conf, such as
[Email protected] ~]# cat/boot/grub/grub.conf
# grub.conf generated by Anaconda
#
# Note that you don't have the to rerun grub after making changes to the This file
# notice:you does not have a/boot partition. This means
# all kernel and INITRD paths is relative to/, eg.
# root (hd0,9)
# kernel/boot/vmlinuz-version RO root=/dev/hda10
# initrd/boot/initrd-version.img
#boot =/dev/hda
Default=1
Timeout=30
Splashimage= (hd0,9)/boot/grub/splash.xpm.gz
Hiddenmenu
Title Fedora Core (2.6.9-1.667)
Root (hd0,9)
kernel/boot/vmlinuz-2.6.9-1.667 ro root=label=/rhgb quiet
Initrd/boot/initrd-2.6.9-1.667.img
Title Other
Rootnoverify (hd0,0)
Chainloader +1
The variables for the Middle grub are described as follows :
Variable description
#:Annotate the menu settings file.
default: Specifies the default operating system. If 0, the operating system displayed in the first paragraph is automatically started when no user input is entered.
Timeout: Sets the time limit (in seconds) before grub starts default. In the 30 seconds.
Splashimage: Specifies the location of the background image used by the default grub boot.
Hiddenmenu: When this command is used, he does not display the Grub menu interface and loads the default after the time-out expires. The user can see the standard Grub menu by pressing the [ESC] key. Can be added in front of the # or delete to achieve the purpose of displaying menu excuses.
title: Sets the options displayed in the Grub menu. One is the display of Fedora Core (2.6.9-1.667), one for other, that is, I use Windows XP.
Kernel: Specifies the Linux kernel address.
INITRD: Specifies the initial memory disk address.
Rootnoverify: Specifies the partition where the boot file is located for sensitive operating systems such as Windows System XP.
Chainloader: +1 indicates the first sector in the specified partition is looking for a boot file.
Illustration 1:The password variable was not listed because I did not select the boot load password when I installed the system. When this variable is used, he can prevent users who do not know the password from editing the menu item.
ways to add passwords to Grub :Using the Grub-md5-crypt command, enter the password you want at the prompt. You can see a series of strange characters that can be copied to the settings file. It is very easy to copy this password from the command line, simply highlight the password with the mouse, open/etc/grub.conf in the text editor, right-click in the desired location, and Linux will automatically insert the highlighted MD5 password.
illustration 2:For convenience,/etc/grub.conf links the settings file/boot/grub/grub.conf of the actual boot loader.
There are some other grub variables that are not listed, and if you want to query more detailed information , you can refer to the following:
Can use the man grub or Info Grub command in the system.
Here are some of the grub sites :
Http://www.gnu.org/software/grub
-Homepage of the GNU GRUB project. This site contains information about the status of Grub development and a FAQ.
Http://www.uruk.org/orig-grub
-Before this project was taken off to the Free Software Foundation for further development of the original grub file.
Http://www.redhat.com/mirrors/LDP/HOWTO/mini/Multiboot-with-GRUB.html
-Study grub for a variety of different uses, including booting non-Linux operating systems.
Http://www.linuxgazette.com/issue64/kohli.html
-An introductory article that discusses the grub settings on a system, including an overview of the GRUB command-line options.
Complementing Ubuntu in the
==============================================================================
Default 0
Timeout 3
Hiddenmenu
Title Ubuntu 9.04, kernel 2.6.28-11-generic
UUID bb77114e-07a7-44a4-9345-4cc9f6e25296
Kernel/vmlinuz-2.6.28-11-generic root=uuid=5e0cc8d2-2b7f-41a5-aa58-acc670569b5f ro Quiet Splash
Initrd/initrd.img-2.6.28-11-generic
Quiet
Title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
UUID bb77114e-07a7-44a4-9345-4cc9f6e25296
Kernel/vmlinuz-2.6.28-11-generic root=uuid=5e0cc8d2-2b7f-41a5-aa58-acc670569b5f RO Single
Initrd/initrd.img-2.6.28-11-generic
Title Windows 95/98/nt/2000
Root (hd0,0)
Makeactive
Chainloader +1
Title Ubuntu 9.04, memtest86+
UUID bb77114e-07a7-44a4-9345-4cc9f6e25296
Kernel/memtest86+.bin
Quiet
==============================================================================
The effect of the above options:
(1) Default 0: This option is the default for which operating system grub starts, and if more than one operating system is installed, grub can specify that the default is to start that operating system. If 0, the first (topmost) operating system is started by default, and if 1, the second is the default, and so on.
(2) Timeout 3: Timeout, Unit is seconds, in this time if the user did not do anything, then the default specified operating system will be started, if it is a positive number, the waiting time is defined as seconds, if it is 0, then immediately into the specified operating system, if it is negative, Then enters the GRUB program interface and waits for the user to choose to enter the specified operating system.
(3) Hiddenmenu: Indicates the hidden GRUB program interface, in Ubuntu system, by default, the program interface of GRUB is hidden, if you want to display, you need to press the ESC key at the prompt.
(4) Title Ubuntu 9.04, kernel 2.6.28-11-generic: Represents the string that is present in the GRUB program interface, which can be any string, in principle using the name of the boot operating system.
(5) root (hd0,1): This is the method of partitioning in grub, and the method of partitioning in the GRUB program is different from the representation partitioning method in Ubuntu, where partitioning is represented in Ubuntu as hda1: where H represents the IDE hard disk, D represents the device, A represents the primary disk in the first IDE device, and 1 represents the first primary partition of the hard disk (see other relevant information for specific allocation information). In grub, it is represented in (hd0,1), where H represents the IDE hard disk, D represents the device, 0 represents the primary disk in the first IDE device, and 1 represents the second partition on the hard disk. Therefore, in the Grub program V, the partition of the hard disk is starting from 0, and the number of hard disks is also starting from 0, such as the Ubuntu system HDB5 in the GRUB program is represented as (hd1,4). Note that the previous root represents the boot partition of the operating system, not the root directory.
(6) Kernel:kernel and its subsequent sections specify a specific kernel file, and depending on the mount point and attributes of the partition, the location of the kernel file and the kernel filename are specified, and the partition with the directory is indicated, and it is mounted in read-only (RO) mode.
(7) INITRD: This part is the file name of the virtual disk.
(8) Chainloader+1: This is the case when there is a Windows operating system, which is the chained boot loader used by Ubuntu, which means that the boot partition with GRUB boot partition moves down directly to the next location (the boot location of Windows).
The configuration of the Grub profile Menu.lst makes it easy to control the boot operating system (there is a large number of # representations in this file).
Grub Configuration Guide