歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> Solaris10 X86Windows2003雙系統引導Grub修復筆記

Solaris10 X86Windows2003雙系統引導Grub修復筆記

日期:2017/2/28 11:19:40   编辑:關於Unix


1、在同一台X86機器上即安裝了Solaris 1/06, 又安裝了Windows,並且使用 Solaris的Grub作為引導程序。
2、由於重裝Windows,會重新覆蓋 MBR,導致Grub不能使用,不能直接啟動Solaris。
################
#問題解決方法:#
################
==需要Solaris X86 1/06的第一張CD光盤或者DVD光盤,就可以重新安裝Grub==
步驟:
1)設置機器並從Solaris X86 1/06光盤啟動
2)在出現Grub界面的時候,按“c”進入grub命令模式,如下界面:
GNU GRUB version 0.95 (640K lower /1046043K upper memory)
Solaris
Solaris Serial Console ttya
Solaris Serial Console ttyb (for lx50,v60 and v65x)

Use the arrow up and arrow down keys to select which entry is highlighted.
Press enter to boot the selected OS,'e'to edit the commands before booting, or 'c' for a command-line.
The highlighted entry will be booted automatically in 60 seconds.
3)在grub命令模式下,找到硬盤上已安裝的Solaris系統(兩種方法選擇其一即可,在find的時候軟驅會很響,不用擔心大概10秒左右結果就輸出了)
grub>find /platform/i86pc/multiboot
(hd0,1,a) ----------系統輸出內容
grub>find /boot/grub/menu.lst
(hd0,1,a) ----------也可以用查找boot menu文件的方法得到同樣的結果
4) 得到Solaris系統安裝所在的硬盤編號後,將它設為root device
例子裡的(hd0,1,a),指的是第1塊硬盤第二個fdisk分區中的第一個slice。
grub>root (hd0,1,a)
Filesystem type is ufs, partition type 0xbf
5) 指定boot和archive文件,最後直接由grub界面啟動Solaris X86系統
grub>kernel /platform/i86pc/multiboot
輸出:[Multiboot-elf,<0x1000000:0x13ab3:0x12906>,shtab=0x1027258,entry=0x1000000]
grub>module /platform/i86pc/boot_archive
輸出:[Multiboot-module @ 0x1034000,0x45bd000 bytes]
grub>boot
此時系統直接從grub命令模式啟動Solaris X86系統(有ufs掛接的系統啟動)
如果記不住這些命令,我們可以借助menu.lst文件,其實這個文件是原grub用於啟動的菜單,並含有這些啟動命令,可供我們參考。一般這個文件的位置在/boot/grub/menu.lst,我們可以使用cat顯示內容。
grub>cat /boot/grub/menu.lst
6) 進入Solaris後,使用root身份安裝grub,最後重新啟動系統
#/usr/sbin/installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0
輸出:Updating master boot sector destorys existing boot managers (if any)
Continue (y/n)? y
stage1 written to partition 1 sector 0 (abs 31455270)
stage2 written to partition 1, 233 sectors starting at 50 (abs 31455320)
stage1 written to master boot sector
# init 6
其中c0d0s0是所安裝的Solaris X86系統的根卷所在位置,該命令會將Grub文件安裝到該硬盤的MBR,至此重新啟動
7) 重新啟動後系統即可將grub修復完成。

附件(/boot/grub/menu.lst有效語句):
# default menu entry to boot ======定義默認啟動的系統序列號
default 2 ======以本例所示:Solaris 10 11/06 s10x_u3wos_10 X86為default 0
Solaris failsafe為default 1
Windows2003Server為default 2
Diagnostic Partition為default 3
# menu timeout in second before default OS is booted ======定義系統等待選擇時間
# set to -1 to wait for user input
timeout 10
#---------- ADDED BY BOOTADM - DO NOT EDIT ---------- ======定義SolarisX86系統正常啟動參數
title Solaris 10 11/06 s10x_u3wos_10 X86
root (hd0,1,a)
kernel /platform/i86pc/multiboot
module /platform/i86pc/boot_archive
#---------------------END BOOTADM--------------------
#---------- ADDED BY BOOTADM - DO NOT EDIT ---------- ======定義SolarisX86系統故障啟動參數
title Solaris failsafe
root (hd0,1,a)
kernel /boot/multiboot kernel/unix -s
module /boot/x86.miniroot-safe
#---------------------END BOOTADM--------------------
title Windows 2003 Server ============定義Other OS啟動參數
rootnoverify (hd0,0)
chainloader +1
title Diagnostic Partition ============定義Other OS啟動參數
rootnoverify (hd0,2)
chainloader +1
Copyright © Linux教程網 All Rights Reserved