2008年11月5日 星期三

以 Grub4dos 設定 WinXP 的多磁區多重開機

grldr文件複製到c:\,去掉boot.ini的只讀屬性,然後修改c:\boot.ini文件,在boot.ini的最後面加一行:
c:\grldr="Start GRUB4DOS"
並將boot.ini中的timeout值設置為大於0的數字,如:timeout=5,然後保存boot.ini,改回只讀屬性。
編輯boot.ini前,可在cmd下輸入:
attrib -s -r -h c:\boot.ini
解除boot.ini的只讀屬性,編輯完後輸入:
attrib +s +r +h c:\boot.ini
恢復boot.ini的原有屬性。

這樣,編輯完重新啟動計算機,在NT的啟動菜單就會出現「Start GRUB4DOS」這一項,選擇該項即可進入grub4dos的環境。此方法的優點是:不需要修改MBR。

使用grub一般都需要grub菜單,把準備好的menu.lst文件放到C:\下(也可放到其它分區根目錄或其它指定目錄)。menu.lst的編寫方法如下:
==================================================================
(以#開始的行,表示註釋,不執行)

# 默認延遲時間(秒)
timeout 30

# 第一項為默認值
default 0

# 設置文件顏色
color white/green yellow/green

# 設置圖形背景文件
splashimage (hd0,0)/boot/grub/xp2008.gz

# 設置中文支持的字體文件
fontfile (hd0,0)/boot/grub/fonts

# Ubuntu 內的 menu.lst 必須配合修改磁區位置,例:(hd0,5)(hd0,7)
title Ubuntu Operating System
find --set-root /sbin/init
savedefault --wait=2
configfile /boot/grub/menu.lst

title 使用map啟動本地硬盤上的瑞星殺毒軟盤鏡像文件
map (hd0,0)/boot/grub/rav.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)

title 使用memdisk啟動本地 Win98 軟盤鏡像文件
kernel (hd0,0)/boot/grub/memdisk.gz
initrd (hd0,0)/boot/grub/win98.img

title 使用memdisk啟動本地硬盤上的瑞星殺毒軟盤壓縮鏡像文件
root (hd0,0)
kernel /boot/grub/memdisk.gz c=80 h=12 s=36 floppy
initrd /boot/rav.zip

title 啟動第一主分區(hd0,0)上的操作系統
rootnoverify (hd0,0)
makeactive
chainloader +1

title 啟動第二主分區(hd0,1)上的操作系統
rootnoverify (hd0,1)
makeactive
chainloader +1

title 重啟
reboot

title 關機
halt
==================================================================

沒有留言: