Grub installation, configuration, and use instance Rollup tutorial

Source: Internet
Author: User
Tags linux

(i) Installing grub when installing Linux

Installing Redhat Linux prompts you to install the bootstrapper, and if you select Grub as the bootstrapper, it is recommended that you install grub to the boot sector of your hard disk Mbr.grub and boot other operating systems, such as FreeBSD, NetBSD, OpenBSD, GNU HURD, and DOS , as well as Windows 95, 98, NT, 2000, XP.

(ii) configuration of Grub

Once you have selected grub as the bootstrapper, let's take a look at its configuration. /boot/grub/grub.conf is grub produces a boot selection menu and sets some options. Here's my grub.conf:

#==========例子开始==========
# grub.conf generated by anaconda #
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,6) # kernel /vmlinuz-version ro root=/dev/hda10
# initrd /initrd-version.img
#boot=/dev/hda default=0 timeout=10 splashimage=(hd0,6)/grub/splash.xpm.gz
# --> Redhat Linux 8.0 <-- title Red Hat Linux (2.4.18-14) root (hd0,6) kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ initrd /initrd-2.4.18-14.img
# --> Microsoft Windows XP <-- title Microsoft Windows XP rootnoverify (hd0,0) chainloader +1
#===========例子结束==========

Configuration options Explanation:

Starting with "#" is the comment line. I have two operating systems, Red Hat Linux and Microsoft Windows XP, respectively. Where the timeout identifies the default wait time, I set this to 10 seconds, more than 10 seconds before the user has made a choice, the default operating system will be automatically selected (my default here is Redhat Linux 8.0)

The default operating system is controlled by the defaults, and the number after the default indicates that the first few are the defaults, where 0 indicates that one and 1 represents the second.

So if you want to modify the default operating system, change the number of defaults. Title one is to set the name of the operating system, grub does not support Chinese (a bit regrettable). Splashimage A background image that specifies the grub interface, interested friends can modify the grub background.

The root (hd0,6) identity launches the search boot kernel from the first hard drive, the 7th partition. Note that root is not the same as the Linux root partition, and this root is also! Grub's hard drive identification method is a little different from Linux. In Linux, the first primary partition is HDA1, the second primary partition is HDA1, the first logical partition is HDA5, and in grub it is identified by (Hdx,y), such as the first primary partition (hd0,0), and so on, the first logical partition is (hd0,1).

So the root of this here is your/boot partition ID. Know where the kernel is, but also to specify which file is the kernel file, this is the work of kernel. KERNEL/VMLINUZ-2.2.18-14 ro

root=label=/. Description/boot/vmlinuz-2.2.18-14 is the kernel to load. The following are the parameters that are passed to the kernel.

Ro is the meaning of readonly. Note that the path in front of my kernel here is "/", because my boot has a separate section, if you do not separate the boot, then the path in front of the kernel is "/boot". INITRD is used to initialize the Linux image and set the corresponding parameters.

Let's look at the definition section of Windows. Here, I have added an item to boot Windows XP. To complete this operation, GRUB uses a "chained loader" (Chainloader). The chain loader loads WinXP's own boot loader from the boot record of the partition (hd0,0) and then directs it. This is why this technique is called chained loading-it creates a chain from the boot loader to the other.

This chained-mount technique can be used to boot any version of DOS or Windows. If you have WIN98,WINME,WIN2K,WINXP in your computer, Chainloader will guide you through the Ntloader of win.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.