Practical Tips: Several Ways to Remove Grub from Linux Systems

  
                  

Linux grub is a very good bootloader that can boot multiple operating systems. When windows and linux coexist, delete grub directly into the windows method:


Scenario 1: Restore the main boot sector MBR (Main/Master Boot Record) with DOS command fdisk---boot with win98 Boot the disk or DOS boot disk to a pure DOS prompt and execute: "fdisk /mbr".


Scenario 2: In the Linux system, restore the MBR. (If you can still log in to the Linux system) --- At the command prompt of the terminal, type: "dd if=/boot/boot.NNNN of=/dev/hda bs=446 count=1" Note that Bs (buffer size) refers to the number of bytes rewritten. Why not 512? The main boot sector is a sector (512 bytes) because we just want to fix the system MBR boot or remove the Grub/LILO boot by a fan command; instead of restoring the entire master boot sector. So we only 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 we installed Linux. If we write all 512 bytes to the main boot sector, it may destroy the hard disk DPT table that has been changed after installing Linux. That's a bad thing!!! (The first 446 bytes of the MBR's 512 bytes are the bootloader, followed by the next 64 bytes for the partition table, and the last 2 bytes for the end tag)

< BR>Scenario 3: Use the tool: Clear MBR 0.9, and run “Clear MBR”.


Scenario 4: The Linux partition has been removed from Windows and stopped at the "grub" prompt after the system boots. Solution:


(1): According to the method of scheme 1


(2): The following


a. in "grub" At the prompt, type: "rootnoverify (hd0,0)" 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.


b. At the "grub" prompt, type: "chainloader +1" Enter. //Transfer the bootstrapping authority to the first sector of the current partition (the first sector of the partition where the Windows system is located).


c. At the "grub" prompt, type: "boot" Enter. The system will start Windows. If it is unsuccessful, it means that (hd0,0) is not the partition where the Windows system is located. Then try the root (hd0,1)/root (hd0,2)/root (hd0,3)/... "In short, this must be able to boot your Windows system."


d. Well, enter Windows, please use the method of scheme 3, easy to get!


(3): Start with WINDOWS disk, enter console mode, run fixboot and fixmbr. The fixmbr command is used to repair the master boot record of the boot disk. It is only available when using the Recovery Console. Its syntax is: fixmbr [device_name], the parameter device_name is the device (drive) to write the new master boot record. The device name is available from the output of the map command. For example, the device name: DeviceHardDisk0, 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 will be written to boot Device, the drive that loads the primary system. If the system detects an invalid or non-standard partition table tag, the user will be prompted to continue with the command. Do not proceed unless you have problems accessing the drive. Writing a new master boot record to the system partition can corrupt the partition table and cause the partition to become inaccessible.

Copyright © Windows knowledge All Rights Reserved