红联Linux门户
Linux帮助

重装XP后恢复Linux启动菜单的方法

发布时间:2007-02-08 12:43:51来源:红联作者:Emperor
1、在重装XP前记下grub 里关于linux启动项里的命令行(这步很关键)
方法:重启出现GRUB菜单,选择linux启动项,按e进入编辑状态就会看到linux启动所需命令行,如果不完整就再按e进入 grub edit 状态
我的是:
root (hd0,6)
kernel /boot/vmlinuz-2.6.12.3 ro root=/dev/hda7 vga=791 splash=silent
initrd /boot/initrd-2.6.12.3.img
我装的MagicLinux 2.0 B3, XP里有三个分区C、D、E,安装ML时 “/ 分区" 4G,然后是 “/home 分区”4G,最后是 swap 。

2、下载 grub for dos,公社就有,我下的是0.41的。
重装XP后把 grub for dos的所有文件和文件夹直接解到C盘根目录,注意,不是放在C盘根目录的一个文件夹里。
编辑boot.ini文件,加入 c:\grldr="GRUB FOR DOS" 方法:右击 我的电脑----属性----高级----启动和故障恢复的设置----编辑,然后保存 关闭。
下面是我的boot.ini文件内容:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
c:\grldr="GRUB FOR DOS"

3、重新启动,现在可以试一下了,在出现启动菜单时选择 GRUB FOR DOS,样会进入一个新的菜单,通常第一项是进入Win用的,选择第二项,按e进入编辑状态,选择第一行再按e进行编辑把内容改成:
kernel (hd0,6)/boot/vmlinuz-2.6.12.3 ro root=dev/hda7 vga=791 splash=silent
按回车回去
再选第二行按e进行编辑:
initrd (hd0,6)/boot/initrd-2.6.12.3.img
如果没有第二行就按 o 键增加一行,再按 e 编辑
全都编辑好后按 b 执行,如果不出意外这时应该可以进入linux了。

4、最后重新做下启动菜单,这和用grub for dos 硬盘安装linux没啥区别,我就不废话了。

我想能用GRUB FOR DOS安装,为什么不试试用它来启动试试呢,没想到成功了。

每个人的电脑都有不同,千万别完全照般,可能没用。
文章评论

共有 2 条评论

  1. 58.145.112.* 于 2007-07-06 00:44:52发表:

    http://b9d381362444acc38a12c31507d8f382-t.lwgmrw.org b9d381362444acc38a12c31507d8f382 http://b9d381362444acc38a12c31507d8f382-b1.lwgmrw.org b9d381362444acc38a12c31507d8f382 http://b9d381362444acc38a12c31507d8f382-b3.lwgmrw.org 7323937625928ec2c2b389a5c949efe8

  2. Emperor 于 2007-02-08 12:44:31发表:

    补充一下,grub for dos启动菜单部分
    在C:\boot\grub下,用记事本打开menu.lst文件进行编辑,下面是我的:

    引用:
    color black/cyan yellow/cyan
    timeout 30
    default 0

    title Microsoft Windows XP Professional (在屏幕上显示的)
    chainloader (hd0,0)+1 (启动命令行)
    rootnoverify (hd0) (启动命令行)

    title MagicLinux 2.0 Bate 3 (在屏幕上显示的)
    kernel (hd0,6)/boot/vmlinuz-2.6.12.3 ro root=/dev/hda7 vga=791 splash=silent (启动命令行)
    initrd (hd0,6)/boot/initrd-2.6.12.3.img (启动命令行)


    title install GRUB on (hd0,0) to MBR (hd0) and reboot. Password: danger
    pause You requested to install GRUB onto MBR. We highly recommend you NOT to do so, basically for two reasons: 1. For some non-MS-compatible boot loaders(in case you might be using), the install is INDEED dangerous and may cause your whole disk(and all your operating systems on it) unaccessible. 2. Even if you are using(in MBR)an MS-compatible boot loader such as LILO and GRUB, you may encounter problems like hard-disk-boot-failure when you move or delete the /boot/grub/stage2 file, or even when disk defragmentation operations are made. Press any key to continue...
    pause A password prompt will confirm that you want the operation anyway. Press any key to continue...
    password danger
    pause This will install GRUB in (hd0,0)/boot/grub/ to MBR. Press any key to begin...
    root (hd0,0)
    setup (hd0)
    pause GRUB install OK! Press any key to reboot your machine...
    reboot

    title install GRUB on (hd0,1) to MBR (hd0) and reboot. Password: danger
    pause You requested to install GRUB onto MBR. We highly recommend you NOT to do so, basically for two reasons: 1. For some non-MS-compatible boot loaders(in case you might be using), the install is INDEED dangerous and may cause your whole disk(and all your operating systems on it) unaccessible. 2. Even if you are using(in MBR)an MS-compatible boot loader such as LILO and GRUB, you may encounter problems like hard-disk-boot-failure when you move or delete the /boot/grub/stage2 file, or even when disk defragmentation operations are made. Press any key to continue...
    pause A password prompt will confirm that you want the operation anyway. Press any key to continue...
    password danger
    pause This will install GRUB in (hd0,1)/boot/grub/ to MBR. Press any key to begin...
    root (hd0,1)
    setup (hd0)
    pause GRUB install OK! Press any key to reboot your machine...
    reboot