---
title: "linux和windows启动菜单详解（Grub和NT Loader）<转>"
author: "zhulin014"
date: "2010-02-20T16:47:59Z"
tags: ["Linux", "OS", "Ubuntu", "Windows", "XP"]
categories: ["操作系统"]
slug: "linux-windows-grub-nt-loader"
draft: false
lastmod: "2010-02-20T16:47:59Z"
id: 599104
url: "https://zhulin014.iteye.com/blog/599104"
---

关系：  
windows－NT Loader－ntldr－boot.ini  
linux－Grub－grldr-menu.lst(menu.lst已加载在grldr中，grldr中的菜单可以用“grub4dos内置菜单编辑器”进行替换)

无论是安装winxp或者是linux系统，都会在mbr处写入引导器。  
windows系统的叫NT Loader，linux的叫Grub原本是Linux上的引导器，与Lilo齐名，Grub和NT Loader可以互相引导，而且Grub4DOS提供的

grldr可以象ntldr一样直接被OS Loader加载），安装多系统时，一般后装的系统会冲掉前装系统的引导器。

一、从boot.ini启动linux（适合winxp装在最后）  
1.所需文件：“grldr、menu.lst、grub4dos内置菜单编辑器”三个文件，用“grub4dos内置菜单编辑器”加载“menu.lst”内容到“grldr”

中，然后复制“grldr”到c盘根目录。（menu.lst可以在linux中提取，位置在：/boot/grub/menu.lst）  
2.在boot.ini最后一行加上“c:\\grldr=" Hiweed Linux "”即可。

二、从Grub启动windows（适合linux装在最后）  
编辑“/boot/grub/menu.lst”文件，  
\-------------------------------------------------------------  
\# grub.conf generated by anaconda  
\#  
\# Note that you do not have to rerun grub after making changes to this file  
\# NOTICE: You have a /boot partition. This means that  
#          all kernel and initrd paths are relative to /boot/, eg.  
#          root (hd0,2)  
#          kernel /vmlinuz-version ro root=/dev/hda5  
#          initrd /initrd-version.img  
#boot=/dev/hda  
default=1  
timeout=5  
splashimage=(hd0,2)/grub/splash.xpm.gz  
title Fedora Core (2.4.22-1.2115.nptl)  
root (hd0,2)  
kernel /vmlinuz-2.4.22-1.2115.nptl ro root=LABEL=/ hdc=ide-scsi rhgb  
initrd /initrd-2.4.22-1.2115.nptl.img  
title winxp  
rootnoverify (hd0,0)  
chainloader +1

\-------------------------------------------------------------  
现在default值为0，意即启动排行第一的操作系统，这里代表的就是Ubuntu, kernel 2.6.15-23-386。  
现在把它修改成“default 1”，那么XP就成为默认的操作系统了。  
因为从零数起，以title打头的Microsoft Windows XP Professional这一行排序为1。  
另外我们还可以通过修改timeout的值来变更默认等待时间。