彻底清除grub,恢复MBR的两种方法

来源:互联网 发布:c语言大全 豆瓣 编辑:程序博客网 时间:2024/06/11 20:51

http://forum.ubuntu.org.cn/viewtopic.php?t=189240

使用ubuntu这么久,没少因为grub损坏启动不了系统而受苦。grub恢复的帖子,论坛里面太多了,这里就不提。

如果你想彻底删除grub,有以下两种方法供参考:

一、windows 光盘:
将Windows的安装盘放入计算机以后,重启计算机,进入Windows安装程序,随后,进入恢复控制台,输入命令fixmbr即可。

二、mbrfix
1、下载mbrfix
http://www.sysint.no/Download/tabid/162/Default.aspx
(MBRFix )
或者见附件

2、解压
将压缩包(mbrfix.zip)解压至系统根目录 C:\

3、修复mbr
a.使用Windows PE光盘启动,进入系统
b.进入cmd命令窗口
c.然后进入mbrfix工具所在的目录
引用:
cd \

d.运行mbrfix修复命令

windows XP
引用:
MBRFix /drive 0 fixmbr /yes


windows vista
引用:
MbrFix /drive 0 fixmbr /vista /yes



附:MBRFix命令:(参考:http://www.sysint.no/nedlasting/mbrfix.htm)
引用:
MbrFix /drive <num> driveinfo Display drive information
MbrFix /drive <num> drivesize Returns drive size in MB as return value
MbrFix /drive <num> listpartitions Display partition information
MbrFix /drive <num> savembr <file> Save MBR and partitions to file
MbrFix /drive <num> restorembr <file> Restore MBR and partitions from file
MbrFix /drive <num> fixmbr {/vista} Update MBR code to W2K/XP/2003 or Vista
MbrFix /drive <num> clean Delete all partitions in MBR
MbrFix /drive <num> readsignature {/byte} Read disk signature from MBR
MbrFix /drive <num> writesignature <hex> Write disk signature to MBR
MbrFix /drive <num> generatesignature Generate disk signature in MBR
MbrFix /drive <num> readstate Read state from byte 0x1b2 in MBR
MbrFix /drive <num> writestate <state> Write state to byte 0x1b2 in MBR
MbrFix /drive <num> readdrive <startsector> <sectorcount> <file>
Save sectors from drive to file
MbrFix /drive <num> /partition <part> fixbootsector <os> 
Update Boot code in boot sector
MbrFix /drive <num> /partition <part> getpartitiontype 
Get partition type
MbrFix /drive <num> /partition <part> setpartitiontype <typenum> 
Set partition type
MbrFix /drive <num> /partition <part> setactivepartition 
Set active partition
MbrFix /drive <num> getactivepartition Get active partition
MbrFix volumeinformation driveletter Get volume information for partition
MbrFix flush {driveletter(s)} Flush files to disk for partition
MbrFix listpartitiontypes List partition types

Drive numbering <num> starts on 0.
Partition numbering <part> starts on 1.

Commands restorembr, fixmbr, generatesignature, writestate, clean, setactivepartition and fixbootsector will ask for confirmation unless /yes is included.

If the /byte option is given for the readsignature command, the signature is returned as a byte array instead of as a DWORD. Writesignature requires the new signature to be specified as 8 hex digits.

If /vista is used with the fixmbr command, a Windows Vista MBR is written instead of a Win2000/XP/2003 MBR. The Vista MBR should work with the other OS'es as well.
0 0
原创粉丝点击