ZT: GRUB Start Manager

xiaoxiao2021-03-06  20

What is the startover manager? The boot manager is a program stored in the disk start sector, for example, the MBR (Master Boot Record) of the hard disk, after the system is started, if the system starts from the MBR, the Bios (Basic Input / Output System) will Control is transmitted to the MBR. The program stored in the MBR will then run. This program is called a starter manager. Its task is to transmit control to the operating system to complete the startup process. There are many available boot managers, including GNU GRUB (Grand Unified Boot Loader), Bootmanager, Lilo (Linux Loader), NTLDR (Boot Loader for Windows Nt Systems), and so on. Below I will discuss GNU GRUB and how it is used. What is grub? GRUB is a powerful launch manager that loads a variety of operating systems such as Windows, DOS, Linux, GNU Hurd, * BSD, and more. Currently, LILO is the most popular launch manager that is used to manage boot of multiple systems. However, if you use Lilo, you must remember that when you change its configuration or install a new kernel, you must re-run Lilo. Moreover, LILO flexibility is also inferior to GRUB. GRUB is flexible. Its latest version, 0.5.96.1, supported file system includes ext2 (a file system used by Linux), FFS (Fast File System Used By * BSD UNIX), Reiserfs (a new log file system developed for Linux, In the 2.4.1 kernel, Minix (a vintage file system developed for the Minix system, is also used in early Linux). Use GRUB, you don't even guide the operating system, you can "see" to these file systems For example, if you want to see the date and time stored in a text file, don't want to guide the entire operating system, you can use the Grub shell (prompt "GRUB>"), type the following command: grub> cat (partition Number) /Home/god/2003106110531.htm.txt. You can see all information related to the file, including the date and time. Grub's best application is that you can easily boot any kernel on any partition in the list. For example, if you don't add newly compiled kernels in the launch list, you need to boot it, you can use it first in the list, use it after restart. But after using GRUB, you can simply use GRUB shell. You can load the required kernel image. Now I will explain three basic steps using GRUB: Compile, Install, and Configure. Step 1: Compile and install GRUB can be from ftp://alpha.gnu.org/pub/ GNU / GRUB downloads the source code of GRUB. You can use the command "TAR-XVZF 2003106110531.htm.tar.gz" to unwield the compressed document. The file I get is grub-0.5.96.1.tar.gz, so I do this: # TAR-XVZF GRUB-0.5.96.1.tar.gz This command placed unwrapping files and directories in a directory called GRUB-0.5.96.1.

Now run as follows: [root @ heaven ~ / grub-0.5.96.1] # ./configure If you want to customize GRUB, make it a popular file system and support for the NIC, or remove the NIC you do not need, you can run The following command: [root @ heaven ~ / grub-0.5.96.1] # ./configure --Help This command will output all command options. You can now add or delete support for specific network cards using the -enable and -disable options. (Note: GRUB Support Network Start) In order to start the compilation process, type the following command: [root @ heaven ~ / grub-0.5.96.1] # Make In order to properly install all files, type the command: [root @ heaven ~ / grub -0.5.96.1] # make install to this, you have already prepared for installing GRUB. Saving GRUB's related files is not a good idea in a directory such as / boot / grub. To do this, follow these steps: 1. By default, all files will be installed in the / usr / share / grub / i386-pc or / usr / local / share / grub / i386-pc directory, depending on your shell variable settings. 2. Create a directory called / boot / grub, then copy the following files to this directory: stage1 stage2 * _Stage1_5 I will explain these files later. At the same time, GRUB (possibly in / usr / sbin or / usr / local / sbin directory) is also copied to the / boot / grub directory. Before installing GRUB, you need to know how GRUB identifies your hard drive and partition information. First, the count starts from 0 instead of from 1. In Linux, your first hard disk connected to the main controller is called "had". "HD0" in the grub. Similarly, in GRUB, your first floppy drive is "fd0". Thus, the first, second, and three partitions on the first block are "HD0, 0", "HD0, 1", "HD0, 2", respectively. Note: The comma is the necessary part of the GRUB partition nomenclature. In order to integrate the partially spaced portion, it is necessary to use parentheses. For example: (HD0, 0) (HD0, 1) (HD0, 2), etc. (HD0, 0) is the first partition on the hard disk. Similarly, (HD1, 5) is the sixth partition on the second fast hard disk, (HD2, 0) is the first partition on the third hard disk. Fe Step 2: Installing GRUB Installing GRUB can be divided into three separate steps: 1. Install "Stage1" into the MBR. 2. Set the address or location of "stage2". 3. Set a menu or option to determine which operating system is started. Use the following command to start installing GRUB. [Root @ heaven / boot / grub] # ./grub This command detects the hardware device according to the setting of the BIOS while generating some output information. This will take a long time. END_REQUEST: I / O Error, DEV 02:00 (FLOPPY), Sector 0 Grub Version 0.5.96.1 (640K Lower / 3072K Upper Memory) Note: Although it is very surprising, Grub does have a simple interface - just support Word edit. Tab lists the list of possible commands.

In other cases, TAB will list the device or file name. It will be very amazing. Similar to the following prompts appear: GRUB> Sorry for Forgetting WHERE I GOT IT, IF you know, Tell Me, Thanks now, I assume that you install Linux in the first extension partition of the first hard disk or / dev / HDA5. Remember the grub's naming rules, change the above name to (HD0, 4). Type the following command: grub> install (hd0, 4) / boot / grub / stage1 (hd0) (HD0, 4) / boot / grub / stage2 p (hd0, 4) /boot/grub/Menu.conf now let us Analyze the details of this command. Install a built-in command, it tells GRUB to install (HD0, 4) / boot / grub / grub / stage1 to the main boot record of the HD0. (HD0, 4) / boot / grub / stage2 tells the GRUB Stage2 map. P with the the backing options: (hd0, 4) /boot/grub/Menu.conf Sets the configuration file for the display of the menu. I will discuss the structure of this configuration file. Below is a summary of this command usage: 1. INSTALL 2. SOURCE_OF_Stage1 3. WHERE_TO_INSTALL 4. Source_of_stage2 5. p Source_of_configuration_file now, you have completed the basic installation work on your hard drive. Install on the floppy disk: In order to install GRUB on the floppy disk, you have to use the "DD" command and understand how it works. To make a GRUB boot disk, you have to put the Stage1 and Stage2 files in the start sector of the floppy disk. Installing a Stage1 to floppy disk: Insert a formatted floppy disk, type command: [root @ heaven / boot / grub] # DD if = stage1 of = / dev / fd0 bs = 512 count = 1 command detailed description is as follows: if = input file ie, stage1 of = output file ie, floppy drive (this may be different on your computer) bs = bytes to read and write Here it is 512 bytes. count = how many times to perform this operation every time copy " BS "number of blocks to the target address. Installing a STAGE2 to floppy disk [root @ heaven / boot / grub] # DD if = stage2 of = / dev / fd0 bs = 512 seek = 1 The step here is the same as STAGE1, except for an SEEK option. The Seek option will be tonified. For example, the value of the BS in the command is 512 so that seek = 1 means that the first 512 bytes on the floppy disk will start from 513 bytes. This will make the first step not override the first 512 bytes of Stage1. Now you have completed the basic floppy drive installation. Step 3: Configure GRUB in this section, let's take a look at how to enter a variety of operating systems after startup, how to build a menu.conf file. We start from the startup process supported by GRUB.

There are two ways to complete the startup process: · a. By calling the kernel Locally, B. Continuous start or forward the control to another boot A mode startup process 1. Set up the device or tell GRUB your root file system. 2. Quantitative Grub's location and transfer the parameters to the kernel. 3. Restart, try it. In order to launch Linux, I put the kernel in the / boot / directory of the file name, and the file system is / dev / hda5, or the GRUB (HD0, 4). My startup process is as follows: 1. ROOT (HD0, 4) [this set the root partition] 2.kernel / boot / bzimage root = / dev / hda5 [this sets the kernel] b mode startup process (this mode assumes Another start manager is installed in the partition, such as LILO or NTLDR: 1. Set the root partition but do not install it 2. Activate this partition 3. Configure the first sector 4 of the partition that needs to be started. Restart, look at the effect. We try to start Widows installed on / dev / hda1 or (hd0, 0). The process of launching Windows is as follows: 1.Rootnoverify (HD0, 0) 2.makeActive 3.chainLoader 1 [ 1 sets the first sector of the current root part] 4.boot [Transfers the control and quits grub] menu.conf file : It is used to establish a menu when starting a multi-operating system. It is not difficult to build menu.conf. It uses simple English, just like you see this section. All menu items start at the beginning without comma-separated "title titlename". You can set the TitleName at will. Setting up the Linux boot menu steps as follows: 1. Set the title 2. Set the root partition 3. Set the corresponding parameter 4 of the kernel. Start a menu example: Title Debian GNU / Linux 2.2 Kernel 2.4.1 root (HD0, 4) kernel /boot/bzimage.2.4.1 boot # ---- Front has a # 行行 is a comment. Establish a menu for starting Windows or DOS: Title Windoze Rootnoverify (HD0, 0) makeactive chainLoader 1 boot # ---- If you have two versions of Windows-one is yourself, the other gives you your family - This second cannot be installed, because there is a prompt saying that Windows is already installed. There is a simple way to install two versions of Windows, that is, hidden a partition when starting, using the other. You can even set password protection for your partition, so you can prevent others to load your partition. The following describes how to complete two Windows installation, HDA1, and HDA2 or (HD0, 0) and (HD0, 1), and the commands used by Lock, Password, Hide, and UnHide.

Establishing a Windows project "My Entry": Title My Entry Lock UnHide (HD0, 0) HIDE (HD0, 1) Rootnoverify (HD0) MakeActive ChainLoader 1 Boot # --- To better use the lock command, you need Use the password command at the beginning of the configuration file. The syntax of the Password command is as follows: Password Secret ("Secret" is a password). You can enter your password by pressing the P key. Establish a Windows project "Family Entry" Title Family Entry UnHide (HD0, 0) Rootnoverify (HD0, 1) MakeActive CHAINLOADER 1 BOOT ---- No one can start this project without entering a password. This has an interesting trick using the password command. In order to hide certain items in the default menu list or configuration file, you can load a customized list using the following command: Password Secret In this command, "Secret" is a password, and / boot / grub / secret-list. Conf is a password file. Before doing this, you have to enter the root directory or give a full path name. For example: Password Secret (HD0, 4) /BOOT/grub/secret-list.conf has a more important command is "MAP". When you have two hard drives, an operating system that cannot be started from the second hard disk, such as Windows, you can use the map command. For example, you can map HD0 to HD1, map HD1 to HD0. In other words, you can virtually swap two hard drives and start the required operating system. The command form is as follows: GRUB> MAP (HD0) (HD1) GRUB> MAP (HD1) (HD0) Start freebsd: title freebsd 4.0 root (HD0, 4, a) kernel / boot / loader boot # --- Here we call FreeBSD start manager. Root (HD0, 4, A) is from four parameters because FreeBSD is virtual segmentation for a separate partition. We call the root partition as "a". If FreeBSD occupies the entire second hard drive, it should be root (hd0, a). This is not to call the kernel but call the FreeBSD start manager, it is easier to use than the calling kernel. (Note: I recommend to try a chain load before using OpenBSD and GNU / HURD.) Now you have completed the basic GRUB compile, install, and configuration. The more you know about GRUB, the more you find that GRUB is an easy-to-use and efficient way to control startup. Various GRUB commands: Default XX indicates that XX is the default startup project Timeout YY indicates that the default startup project will launch Fallback ZZ after the first startup project failed, will start the ZZ project. . The Color This command will generate a color menu. Its syntax is: Color Normal Current_Serection. Both domains can have two values, like foreground / background. For example: Color Green / Black or Light-Gray / Blue You can also use the relevant numbers.

Remember: All values ​​start from 0, so 0 is the first. In my next article, I will talk about the test of GNU / HURD AND OpenBSD, perhaps some of the contents of the network boot. But you have to wait for at least three months or more, but I will talk about my test results. Waiting to see it. *********************************************************** *********************************************************** *******

Here is just the hard drive installation, the disc installation does not need to be discussed, and the disc is placed in. Download: http://www.linuxfans.org/nuke/modules.php?name=forums&file=viewtopic&t=67894 The official mirror is relatively fast. Put three ISOs under a FAT32 partition and do MD5 check for ISO after downloading. 1. GRUB installation (applicable Linux system installed.) Loading ISO file # mount /path/fc2-i386-disc1.iso / mnt / cdrom copy vmlinuz, initrd.img to / boot directory # CP / MNT / CDROM / ISOLINUX / Initrd.img / Boot/initrd.img # cp / mnt / cdrom / isolinux / vmlinuz / boot / vmlinuz modified GRUB.CONF, Add: Title Fedora Core 2 setup root (HD0, 6) kernel / boot / vmlinuz root = / dev / hdxy init /boot/initrd.img Restarts to select this item, you can install it. 2. Startup installation using CD: Slow Boot.iso in the iMages / Directory in the first disk from ISO, then engrave, start from the disc. 3. Start using the USB USB flash drive: Since BootDisk.img in the iMages / Directory in the first disk, Since the ISO,

Then use Rawrite, HDCopy, and it is written to the USB flash drive and restarts from the USB flash drive. 4. Install from DOS: Built a boot directory in a FAT32 partition, let VMLinuz initrd.img in the iMags / PXeboot / directory in the first disk from ISO to put this boot / directory. Create a new autoboot.bat is loadlin vmlinuz initrd = initd.img ramdisk_size = 9216, then download a loadlin.exe, use 98 disk to enter pure DOS, enter the boot directory to run autoboot.bat

All the above enters the installer method, to formally start the hard disk installation, you also need to select the hard disk installation when selecting the installation method, then let you choose the storage path of the ISO file, select the partition, then fill in the directory name, if you ISO is placed in the partition root directory without being filled with a directory name. Now you can really install Fedora Core 2 in your hard drive.

转载请注明原文地址:https://www.9cbs.com/read-39837.html

New Post(0)