|
|
发表于 2006-9-9 02:10:27
|
显示全部楼层
一 : 玩转 GRUB
##########################################################################################################################################
GRUB 的 command 模式。
想办法启动GRUB,如果GRUB设有密码,先按 P 键 解密。
再按 C 键 进入 command 命令模式。
##########################################################################################################################################
GRUB命令:
##########################################################################################################################################
map (hd0) (hd1) 将hd0仿真为hd1
map (hd1) (hd0) 将hd1映射为hd0 注意:这两条命令都要用上,先后次序可以巅倒。
chainloader (hd0)+1 加载hd0的第一个扇区 (仿真后的hd1)
boot 启动
注意:
第一条命令,是将hd1映射为hd0;
第二条命令,是将hd0,映射为hd1。
两条命令的作用相当于在BIOS中设置第一启动为第二(硬盘)设备;第二启动为第一(硬盘)设备。
第三条命令,从 hd0 的第一的第一扇区加载 引导代码。由于前面的两条命令使 hd1 成了 hd0 ; hd0 成了 hd1 。所以这里实际上是加载的 hd1 的第一扇区(MBR)中的引导代码。
第四条命令,就是告诉系统可以引导了。
举一反三。
对于GRUB安装在非 MBR 的 ,而是安装在 硬盘的某个分区的第一扇区 的。 可以使用 (hdx,y) 来表示。
例:
map (hd0) (hd1)
map (hd1) (hd0)
chainloader (hd0,7)+1
boot
*****************************************************************************************************************************************
Map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive.
*****************************************************************************************************************************************
上面的是使用命令的方式。
当然也可以把这段保存到 /boot/grub/menu.lst
帖一下我的文件:
##########################################################################################################################################
# Modified by YaST2. Last modification on Tue Sep 5 23:25:11 CST 2006
color white/blue black/light-gray
default 0
timeout 8
password --md5 $1$Y40ks/Mg$vuShtd7vx.J.dcDb0ZZia0
gfxmenu (hd0,9)/boot/message
###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE Linux Enterprise Server 10
root (hd0,9)
kernel /boot/vmlinuz root=/dev/hda10 vga=0x31a resume=/dev/hda9 splash=silent showopts
initrd /boot/initrd
###Don't change this comment - YaST2 identifier: Original name: windows 1###
title /dev/hda Disk master
chainloader (hd0,0)+1
###Don't change this comment - YaST2 identifier: Original name: windows 2###
title /dev/sda Disk slave
map (hd0) (hd1)
map (hd1) (hd0)
chainloader (hd1,0)+1
###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- SUSE Linux Enterprise Server 10
root (hd0,9)
kernel /boot/vmlinuz root=/dev/hda10 vga=normal showopts ide=nodma apm=off acpi=off noresume edd=off 3
initrd /boot/initrd
##########################################################################################################################################
*******************************************
#gedit /boot/grub/menu.lst
*******************************************
仔细分析一下这里的的文件,你就会明折了。
相信聪明的你一定能搞定的。
*******************************************
二: 主板热键
##########################################################################################################################################
通常,在启动计算机后,在BIOS通过自检后,按键盘上的一个键可以选择从什么设备启动机器。这个键叫做主板热键。
微星主板的热键是 F11 或者 F12 什么的。
华硕的主板的热键是 F8 键,和 Windows 安全模式的热键相同。如果机器上只安装了一个Windows的操作系统,想进安全模式有点小难。方法是,开机后按 F8键,选择硬盘启动,右手敲回车的后零点一秒,右手已经按下F8键。这时就可以进安全模式了。 还有一个办法是添加一条引导记录,并且保证启动时的 timeout 不为 0 。
总之,按主板热键就可以在不进 BIOS 的情况下 选择从什么设备启动。
########################################################################################################################################## |
|