GRUB installation and repair

xiaoxiao2021-03-06  42

Installation of three systems with Grub:

Swordsman Time: 2003-04-28 Document Type: From:

Blue ideal

RedHat9 and Mandrake 9.1 have been released separately in the last month, and the author as the fanthatic enthusiasts of Linux, certainly can't let go such a good opportunity, download, engraved ing ... but if they get together, using GRUB is the most Good way, because it is the redhat default installation, GRUB is, which is the system's boot program, use it to guide the three systems, no problem, nor to find another toll software everywhere.

First, partition

There are two hard drives in my computer. The basic idea is 80G for WIN system, 10G hard drives 2 Linux systems, the first hard disk already has a Win2K system, if you have only one hard drive, you can use PQ to divide an empty area Out, then a swap partition is drawn in the empty area, the format is / swap, the size is generally 1.5 times the memory, if your memory is 512M or the exchange partition and the memory size is the same, then two The size of about 5 g is 5g, formatted into EXT3. The advantage of this is that when the Linux system is installed, the WIN system does not become very slow because it does not recognize the EXT3 format.

Second, install Linux system

It is already very convenient to install Linux now. Just press the prompt on the screen, the system installation does not divide, but the grub is installed on the MBR of the hard disk HDA1 when installing RedHat9, installing the LILO or GRUB when installing mandrake9.1 The first sector of / boot is OK. In Linux, the primary partition is HDA1, the primary partition of the second hard disk is HDB1, and the logical partition starts from HDA5. If there are two hard drives, it may be starting from HDB5, so pushing in this class. If you don't know what is going on, use fdisk -l or DF-LA to view. To install the system, there will be the corresponding installation location, which is also the HDAX or HDBX partition, and there is no WIN's C and D disk under Linux.

Third, modify GRUB.CONF

The system is installed, but now you can only boot the RedHat9 and WIN system, you must change /boot/grub/grub.conf to allow three systems to run normally, use root users to enter the system, first view your partition in fdisk -ld terminal The situation, knowing the partition is good, use any file editor to open /boot/grub/grub.conf, in general, the WIN system will automatically load it into the grub, below is the author's grub.conf file, we To analyze default = 0timeout = 10splashImage = (HD1, 2) /BOOT/grub/splash.xpm.gztitle Windows2k Rootnoverified (HD0, 0) CHAINLOADER 1TITLE RedHat9 root (HD1, 2) kernel /Boot/VMLinuz-2.4.20 -8 Ro root = label = / initrd /boot/initrd-2.4.20-8.imgtitle Mandrake9.1kernel (HD1, 4) / boot / vmlinuz root = / dev / hdb5 quiet devfs = mount ACPI = OFF VGA = 788initrd ( HD1, 4) /boot/initrd.img

Default = x is the default system, 0 is the first system, which is pushed in this class. Timeout = X is the time of the GRUB menu, the unit is a second title XXX, XXX is the title, that is, the name of the operating system you want to boot, you can modify root (hdx, y) x and y all represent a value, X is Which hard disk of the root partition of Linux is. If you have only one hard drive. That is HD0. If a release of your Linux is installed in the second hard drive, this x is 1. Y is which zone represents the Linux you install. This value is a bit different, and it is not very clear. For example, please. For example, I mount Mandrake to the second partition of the second hard disk, that is, HDB5. Then his root (hdx, y) should be written as root (HD1, 4), that is, Y = HDAZ or HDBZ minus 1. KERNEL (HDX, Y) / Boot / VMLinuz Root = / dev / hdaz and initrd (hdx, y) /boot/initrd.img is the image and initrd file to boot which hard disk partition, must write the correct XY value, otherwise Unable to boot the system. Quiet devfs = mount ACPI = OFF VGA = 788 is the start-up parameter. Rootnoverify (HDX, Y) If you can't start WIN, you can change to root (hdx, y). CHAINLOADER 1 means that the first track on this partition is specified to start

To join the other operating system into the grub in the redhat, this is not the case, as in other releases, the principle is the same. This is similar to Boot.ini in Win2K and XP, GRUB is very simple, try it a few times.

Finally, of course, the deposit is restarted. At this time, we can enjoy the fun of multi-system peace.

Reload GRUB method

Generally, our hard drive is installed in a red flag, such as Windows98, or Win2000, XP, then Windows will rewrite MBR (main boot record) when we reinstall Windows, so our red flag cannot be correctly guided Here, here is given my solution.

Prerequisites: Making the boot floppy disk when installing the red flag 3.2.

Use the boot disk to guide the red flag Linux.

In the terminal or in the RXVT, according to the following steps.

#grub

GRUB> root (HD0 ,?)

# This line of comments, HD0 is assumed that you are a single hard disk, I think there should be this # 样, "?" The specific content will depend on your Linux root partition and # 定, for example, you are installed in HDA1, then 0, assuming is installed in HDA5, then # is 4, is the actual partition number minus 1.

GRUB> Setup (HD0)

# 注释, installed in MBR.

If you don't want to install in MBR, you can change the last step to

GRUB> Setup (HD0, 4)

This is installed in HDA5, first assume that your Linux is installed in HDA5.

It is completed here.

This method can also be used if you are Linux booted with Windows OS Loader.

With the installation disk to repair GRUB [rpm] http://www.chinaunix.net Author:

Hopecao

Published in: 2002-12-05 11:37:25

Repair GRUB with installation disks

[linuxsir.com]

1. Problems to be solved in this solution:

When we install WIN, we will clean up GRUB or LILO from MBR. If there is no system boot floppy disk with only the installation disk, the solution is taken. There is also a way to use an upgrade system for the Upgrade system. This method is extremely unreliable. After nearly two or thirty-ten practice, we prove that there is almost very few, this method is used to not install GRUB or is also possible. If you have installed the GRUB installation, later reinstall the LILO with the Window or other operating system, it will not be able to guide the system normally, which is invalid. Therefore, this program is best suited for GRUB recovery.

Second, the process of resolution [Take RedHat 7.3]

1. Put the first place of the mounting disk in the CD drive, then restart the machine, and boot the system in BOIS.

2. After the installation interface comes out, press the [F4] button, which is Linux Rescue mode.

3. A series of keyboards and several simple formulations, [Continue] afterwards. . . This process, I don't say it, it is relatively simple.

4. Then there will be such characters

SH #

5. We can operate GRUB. . . what. . . As long as there is such an example, it is a small Kiss, I just don't say, no one can understand, the earth people know. . . .

SH # grub

There will be such characters

GRUB>

We can enter behind this character.

Grub> root (hdx, y)

GRUB> Setup (HD0)

If success, there will be a successful ...

Here, if it is a disk, it is 0. If the root partition of Linux you install is on the second hard disk, that X is 1; Y, is the root partition where the Linux system is located. Setup (HD0) is to write GRUB to the MBR of the hard disk.

Let me give an example, if I take my hard drive as an example. I installed XP on the first hard drive, put RH73 in the first hard disk. I have two hard drives. If I lost GRUB, I used this way to find it. If you don't know which partition is installed in your Linux, that is, don't know how much this Y is, this is not tight, first enter root (hdx, then use [Tab] to view, you will understand ...

The operation is as follows: [There is an explanation above the front boot]

SH # grub

The following words will appear

GRUB>

Then you do this, if I know that my Linux is on the first hard disk, but I don't know which partition is installed, you can enter root (HD0, then use the [Tab] button to make up, then understand .

[Code: 1: 3249BF1C31]

GRUB> root (HD0, 8)

GRUB> Setup (HD0)

[/ Code: 1: 3249BF1C31]

Please let the brothers combine the articles and this example, think about it carefully.

The partition of my first hard disk is like this. .

/ DEV / HDA1 primary partition NTFS

/ DEV / HDA2 extension partition

/ dev / hda5 NTFS

/ dev / hda6 fat

/ dev / hda7 fat

/ dev / hda8 / boot ext3

/ DEV / HDA9 / EXT3

/ DEV / HDA10 / SWAP EXT3

Finally, press the [RESET] button, restart, it is OK. . . . This step should be the easiest. . . what. . . .

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

New Post(0)