Restoration of Grub loss in both Linux and Windows operating systems

Source: Internet
Author: User
Article Title: Grub loss recovery in both Linux and Windows operating systems. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

When we re-install Windows, the MBR will be overwritten, so that the original GRUB or LILO will disappear, or for some reason, the original GRUB will disappear, you only need to reinstall GRUB at this time.

There are many methods to reinstall GRUB. This method does not work. Try another method:

1. Start with the installation CD, select upgrade and installation, and then select only GRUB installation.

2. start with the installation CD, enter linux rescue in BOOT, that is, enter rescue mode, and enter chroot/mnt/sysimage at the command prompt # displayed, then enter grub-install/dev/hda to complete the operation...

3. How can I fix the grub/lilo boot menu without a soft drive?

A. Copy the dosutils directory in the first linux installation disk to the windows disk. If it is iso, you can use winrar3 for extraction.

B. Enter pure dos, enter the dosutils directory, and execute loadlin autoboot/vmlinuz root =/dev/hdxx () hdxx as your linux root partition. In this way, you can enter linux.

C. Run grub-install/dev/hdx (x = a, B, c, d) or lilo to rewrite the boot.

Also can refer to: http://www.linuxfans.org/nuke/modul...iewtopic&t=5101

4. If you use grub to guide linux and windows, the grub in MBR will be damaged after windows is re-installed due to a problem, and grub needs to be restored.

A. Place the first installation disc of linux to the optical drive, restart the machine, and use the optical drive to guide the system in BOIS.

B. After the installation interface is installed, press the [F4] key, that is, the linux rescue mode.

C. A series of keyboards and a few simple preparations, and then [continue... This process is simple.

D. Then the prompt will appear:

Sh #

E. We can operate GRUB. Enter grub:

Sh # grub

The following prompt appears:

Grub>

After such a character, we can enter:

Grub> root (hdX, Y)

Grub> setup (hd0)

If it succeeds, there will be a successful ......

X here, if it is a disk, It is 0. If the root partition of the linux installation is on the second hard disk, X is 1; Y, is the root partition where the linux system is installed. Setup (hd0) is to write GRUB to the hard disk MBR.

In addition, some people say that I have not installed a CD? I installed it from the hard disk. Oh, so your ISO file is still there. So the installation interface is the same again ....

5. How to delete GRUB or LILO?

Just execute FDISK/MBR in DOS...

How to configure grub?

Modify the/boot/grub. conf file. Where

"Default = n" (n is a number) is the default item selected in the grub boot menu. n starts from 0. 0 indicates the first item, 1 indicates the second item, and so on.

"Timeout = x" (x is a number) is the timeout time, and the Unit is wonderful. That is, after the boot menu is displayed, if you do not select within x seconds, grub starts the default item.

"Splashimage = xxxxxx", which is the background image of the boot menu. Ignore it first.

The following example describes other common items:

Title Red Hat 8.0

Root (hd1, 6)

Kernel/boot/vmlinuz-2.4.18-14 ro root =/dev/hdb7

Initrd/boot/initrd-2.4.18-14.img

"Red Hat 8.0" is the name displayed in the Startup Menu list.

Root (hdx, y) is used to specify the location of your boot partition. If you are not divided into boot partitions (in this example, boot partitions are not divided), you can point to the root partition, hdx is the hard disk of linux, hd0 is the first hard disk, hd1 is the second disk, and so on. Y is the partition location, starting from 0, that is, it is equal to the partition number minus one. For example, if the partition you want to point to is hdx7, then y is 6. If it is hdx1, y is 0. Note that there must be a space behind root.

Kernel/boot/vmlinuz-2.4.18-14, where "/boot/vmlinuz-2.4.18-14" is the path to the kernel you want to use, if you have compiled the core, change it to the path of your new kernel.

Ro does not need to worry about it. There is no mistake in writing it.

Root =/dev/hdxx specifies the root partition. In this example, It is hdb7, so root =/dev/hdb7

The initrd xxxxxxxxxxxxx line does not work either. Currently, I still don't know what it is used.

The above is linux, and the following is windows

Title windows 98

Rootnoverify (hd0, 0)

Chainloader + 1

Title xxxxxxx does not need to be explained.

Rootnoverify (hdx, y) is used to specify the partition where windows is located. x and y are the same as above. Note that there are spaces after rootnoverify.

Just copy chainloader + 1 and pay attention to spaces.

Related Article

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.