免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1145 | 回复: 0
打印 上一主题 下一主题

windows ntldr引导linux+redhat9.0引导修复 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-11 09:14 |只看该作者 |倒序浏览

windows ntldr引导linux+redhat9.0引导修复
作者: techo 发表日期: 2006-06-01 12:21 文章属性: 原创
复制链接

[原创]windows引导linux+Redhat9.0引导修复(申请加精)第一部分介绍windows ntldr引导linux
第二部分介绍修复linxu9.0引导的GRUB安装方法
第一部分:
所需软件:矮人DOS4.2,GRUB FOR DOS,Linux AS4 光盘镜像.
NTLDR loader配合grub 引导Red Hat linux Enterprise AS4.
本文目的是利用windows 系列OS Loader来引导linux,主要适用于硬盘安装Red Hat linux Enterprise AS4
环境:winxp sp2+Red Hat linux Enterprise AS4
硬盘分区: /hda1-----------8G.   NTFS.........C盘
windows:   /hda5-----------5G.   NTFS.........D盘
        /hda6...........8G:   NTFS.........E盘
        /hda7...........43G   NTFS.........F盘
        /hda8...........2.6G FAT32........G盘
        
linux:     /hda9..........101MB EXT2       /boot .....linux boot分区
        /hda10.........512MB swap       SWAP:...... linux交换分区
        /hda11.........9.6G EXT3       / ....... linux根分区
执行过程:
(1)/hda1即C盘安装XP SP2.
(2) linux安装在(/hda11)上,把linux GRUB安装在/boot分区(/hda9)上即可。
(3)复制GRUB for dos里所有文件到C盘根目录下,并提取矮人DOS4.2(提取方法自己去想吧)里的memdisk.gz文件复制到c:\boot\grub\下,提取
linux第一章光盘镜像里的ISO文件夹至C盘根目录,并且提取光盘images里的diskboot.img文件到c:\boot\grub\下。
(4)编辑c:\boot\grub\menu.lst,在最后添加:
title 安装 Fedora Core 4
kernel (hd0,0)/isolinux/vmlinuz --type-linux reiserfs
initrd (hd0,0)/isolinux/initrd.img
title 运行 Fedora Core 4 启动盘
root (hd0,0)
kernel (hd0,0)/boot/grub/memdisk.gz
initrd (hd0,0)/boot/grub/diskboot.img
说明:第一个用于硬盘安装linux AS4
    第二个用于启动linux rescue救援模式(硬盘安装linux后启动救援模式方法)
(5)重启后,进入grub for dos菜单,选择"Fedora Core 4 启动盘",进入启动画面,输入:linux rescue(进入linux救援模式),选择语言种类,
键盘类型,不启动网络接口,最后进入#sh,下输入
# chroot /mnt/sysimage (切换到根目录)
# mkdir /mnt/win(创建一个挂载windows分区的目录,前提是该分区格式须为FAT32)
# mount -t vfat /dev/hda8 /mnt/win(挂载/hda8到/mnt/win目录下)
# dd if=/dev/hda6 of=/mnt/winc/bootfc4.lnx bs=512 count=1 (提取AS4引导文件至hda8分区即G盘)
最后我们键入exit退出.
(6)重启到xp,把保存到G盘的bootfc4.lnx移动到c盘,用文本编辑器打开boot.ini
在最后添加一行c:\bootfc4.lnx="进入Red Hat linux Enterprise AS4"
最后文件内容为:
[boot loader]
timeout=10
default=C:\grldr
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
c:\bootfc4.lnx="进入Red Hat linux AS4"
C:\grldr="grub for dos"
我们保存重启,就有了AS4的启动菜单.\
日后系统引导文件备份与恢复方法:
一、备份
C:\boot.ini
c:\grldr         
c:\boot目录                 
c:\iso目录 AS4第一张光盘
C:\boot\grub\menu.lst 这个很重要
C:\boot\grub\diskboot.img AS4第一张光盘
二、恢复
重装XP后,恢复以上文件至C盘即可
Linux AS4重装,如果/boot分区没有修改,就按照以上方法重新启动救援模式,提取linux引导文件bootfc4.lnx至C盘,并且在boot.ini里最后
添加 c:\bootfc4.lnx="进入Red Hat linux AS4" 即可。
对于其他版本的linux,原理应该都一样。
补充:也可以完全用Grub for dos 来管理硬盘上不同操作系统引导,修改C:\BOOT\grub\menu.list文件如下:(蓝色部分)
menu.list文件内容如下:
# This is a sample menu.lst file. You should make some changes to it.
# Added items for installing GRUB [ which is on your DOS drive C: ] to MBR
color black/cyan yellow/cyan
timeout 60
default 0
title WINDOWS XP on (hd0,0)   (引导C盘的WINDOWS XP,引导记录位于C盘根目录)
chainloader (hd0,0)+1
rootnoverify (hd0)
title Red Hat Linux Enterprise AS 4 on (hd0,8)     (引导red hat linux AS4,其引导文件在/boot分区即/hda9)
root (hd0,8)
kernel /vmlinuz-2.6.9-5.EL ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.9-5.EL.img
........
........
title 安装 Fedora Core 4
kernel (hd0,0)/isolinux/vmlinuz --type-linux reiserfs           (硬盘安装red hat linux AS4)
initrd (hd0,0)/isolinux/initrd.img
title 运行 Fedora Core 4 启动盘
root (hd0,0)
kernel (hd0,0)/boot/grub/memdisk.gz                       (硬盘安装法,修复启动linux AS4的救援模式)
initrd (hd0,0)/boot/grub/diskboot.img      
menu.list结束,中间没用的省略。           
第二部分:
下面介绍Red Hat linux9.0,GRUB安装在MBR上,重装XP后,修复linxu9.0引导的GRUB安装方法:
放入linux9.0第一张光盘,进入后,看到提示boot:,输入linux rescue,进linux救援模式
进行一些语言,键盘的选择后,确定救援后进入救援模式,然后输入一下命令:
#chroot /mnt/sysimage(切换到真实的linux根目录下)
#grub-install /dev/hda(即可安装Grub到MBR主引导记录上)
重启后,出现linux GRUB引导界面
  windows
  linux
以上操作,已经测试通过,如果有问题请发论坛短信或跟帖说明。
声明:本文仅供交流与参考。部分操作有一定的风险,请慎重操作!!

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/13493/showart_126414.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP