Methods for clearing grub

Source: Internet
Author: User
Methods for clearing grub-general Linux technology-Linux technology and application information. For more information, see the following. Linux grub is a very good boot program that can guide multiple operating systems. When windows and linux coexist, delete grub and go directly to windows:

Solution 1: Use the doscommand fdisk to restore the Master Boot Sector MBR (Main/Master Boot Record) --- use the win98 Boot disk or DOS Boot disk to Boot the system to a pure DOS prompt and execute: "fdisk/mbr.

Solution 2: Restore MBR in Linux. (If you can still log on to Linux) --- enter "dd if =/boot. NNNN of =/dev/hda bs = 446 count = 1 "NOTE: bs (buffer size) indicates the number of bytes to be overwritten. Why not 512? The primary Boot Sector is a single sector (512 bytes), because we just want to use the fan-plane command to repair the boot of the system MBR or delete the Grub/LILO boot, rather than restoring the entire primary Boot Sector. Therefore, we only need to rewrite the first 446 bytes of the backup file boot. NNNN of the primary boot Sector to the primary boot Sector. Boot. NNNN is the backup of the entire primary boot partition before Linux is installed. If we write all the 512 bytes into the primary Boot Sector, the disk DPT table changed after Linux is installed may also be damaged. That's a bad thing !!! (The first 512 bytes of MBR are the boot program, followed by 64 bytes as the partition table, and the last two bytes are the end mark)

Solution 3: run the Clear MBR 0.9 tool and run "Clear MBR.

Solution 4: Linux partitions have been deleted from Windows. After the system is started, stop at the "grub>" prompt. Solution:

(1): Follow solution 1.

(2 ):
1. Enter "rootnoverify (hd0, 0)" at the "grub>" prompt and press Enter. // Set the first partition (0) of the first hard disk (hd0) as the root partition/root device, but do not load the file system.

2. Enter "chainloader + 1" at the "grub>" prompt and press Enter. // Forward the boot guide to the first sector of the current partition (the first sector of the partition where the Windows system is located ).

3. Enter "boot" at the "grub>" prompt and press Enter. The system starts Windows. If it fails, it indicates that (hd0, 0) is not the partition where the Windows system is located. Try "root (hd0, 1)/root (hd0, 2)" from the first step) /root (hd0, 3 )/... in short, this will certainly boot your Windows system.

4. All right. Go to Windows. Please use solution 3 to handle it easily!

(3) start from a WINDOWS disk, enter the console mode, and run fixboot and fixmbr. The fixmbr command is used to fix the Master Boot Record of a disk. It is only available when the fault recovery console is used. Its syntax is: fixmbr [device_name], the device_name parameter is the device (drive) to write a new Master Boot Record. The device name can be obtained from the output of the map command. For example, the device name is DeviceHardDisk0, and the following command example writes a new Master Boot Record to the specified device: fixmbr DeviceHardDisk0

NOTE: If device_name is not specified, the new Master Boot Record is written to the boot device, that is, the drive of the Master System is loaded. If the system detects invalid or non-standard Partition Table tags, it will prompt the user to continue executing the command. Do not continue unless you have problems accessing the drive. Writing a new primary Boot Record to the system partition may damage the partition table and cause the partition to be inaccessible.
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.