📄 597.html
字号:
kernel /boot/vmlinuz-2.2.18 root=/dev/hda3 ro<br>
说明/boot/vmlinuz-2.2.18 就是要加载的内核。后面的都是传递给内核的参数。<br>
root=/dev/hda3就是linux的硬盘分区表示法,ro是以readonly的意思。<br>
initrd用来初始的linux image,并设置相应的参数。 <br>
下面看一看windows的定义段。<br>
这里,我添加了一项来引导 Windows2000。要完成此操作,GRUB 使用了“链式装入器”
(chainloader)。链式装入器从分区 (hd0,0) 的引导记录中装入 win2000自己的引导装入器,
然后引导它。这就是这种技术叫做链式装入的原因 -- 它创建了一个从引导装入器到另一个的
链。这种链式装入技术可以用于引导任何版本的 DOS 或 Windows。<br>
<br>
我的RedHat linux在硬盘主引导分区装了lilo,所以也用了chainloader。 <br>
GRUB的配置文件要简单就这么简单,如果你要更个性化一点,试一试,把
“color light-gray/blue ”加在default语句的下面,下一次激活GRUB时,看看有什么变化,
再试一试“color light-blue/red",惊喜吗? 有趣吧! <br>
<br>
<br>
GRUB的交互性<br>
GRUB 最好的优点之一就是其强健的设计 -- 在不断使用它时请别忘了这点。 如果更新内
核或更改它在磁盘上的位置,不必重新安装 GRUB。事实上,如有必要,只要更新 menu.lst
文件即可,一切将保持正常。 <br>
只有少数情况下,才需要将 GRUB 引导装入器重新安装到引导记录。首先,如果更改
GRUB root 分区的分区类型(例如,从 ext2 改成 ReiserFS),则需要重新安装。或者, 如
果更新 /boot/grub 中的 stage1 和 stage2 文件,由于它们来自更新版本的 GRUB, 很有可
能要重新安装引导装入器。其它情况下,可以不必理睬! <br>
GRUB的最大的特点就是交互性特别强。在开机时,按一下“c”,将进入GRUB 控制台。显示如下: <br>
GRUB version 0.5.96.1 (640K lower / 3072K upper memory) <br>
<br>
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ] <br>
<br>
grub> <br>
<br>
欢迎使用 GRUB 控制台。现在,再研究命令: <br>
我将通过GRUB 控制台绕过lilo来激活RedHat linux, <br>
<br>
grub> root (h <br>
<br>
现在,按一次 Tab 键。如果系统中有多个硬盘,GRUB 将显示可能完成的列表,从
"hd0" 开始。如果只有一个硬盘,GRUB 将插入 "hd0,"。如果有多个硬盘,继续进行,
在 ("hd2") 中输入名称并在名称后紧跟着输入逗号,但不要按 Enter 键。部分完成的
root 命令看起来如下:<br>
grub> root (hd0,<br>
现在,继续操作,再按一次 Tab 键。GRUB 将显示特定硬盘上所有分区的列表,以及它们
的文件系统类型。在我的系统中,按 Tab 键时得到以下列表:<br>
grub> root (hd0, (tab,按tab一下键) <br>
Possible partitions are: <br>
Partition num: 0, Filesystem type is fat, partition type 0x6 <br>
Partition num: 2, Filesystem type is ext2fs, partition type 0x83 <br>
Partition num: 4, Filesystem type unknown, partition type 0x7 <br>
Partition num: 5, Filesystem type is ext2fs, partition type 0x83 <br>
Partition num: 6, Filesystem type is fat, partition type 0xb <br>
Partition num: 7, Filesystem type is fat, partition type 0xb <br>
Partition num: 8, Filesystem type is ext2fs, partition type 0x83 <br>
Partition num: 9, Filesystem type unknown, partition type 0x82 <br>
如您所见,GRUB 的交互式硬盘和分区名称实现功能非常有条理。这些,只需要好好理解
GRUB 新奇的硬盘和分区命名语法,然后就可以继续操作了<br>
grub> root (hd0,8) <br>
现在已安装了 root 文件系统,到装入内核的时候了 <br>
grub> kernel /boot/vmlinuz-2.4.2 root=/dev/hda5 ro <br>
[linux-bzImage, setup=0x1200, size=0xe1a30] <br>
<br>
您已经安装了 root 文件系统并装入了内核。现在,可以引导了。只要输入"boot",
linux 引导过程就将开始。是不是很cool啊,GRUB的menu.lst更像一个linux 下的脚本程序。 <br>
<br>
GRUB激活盘<br>
要制作引导盘,需执行一些简单的步骤。首先,在新的软盘上创建 ext2 文件系统。然后,
将其安装,并将一些 GRUB 文件复制到该文件系统,最后运行 "grub" 程序,它将负责设置软
盘的引导扇区。准备好了吗? <br>
<br>
将一张空盘插入 1.44MB 软驱,输入: <br>
# mke2fs /dev/fd0 <br>
创建了 ext2 文件系统后,需要安装该文件系统: <br>
# mount /dev/fd0 /mnt/floppy <br>
现在,需要创建一些目录,并将一些关键文件(原先安装 GRUB 时已安装了这些文件)
复制到软盘: <br>
# mkdir /mnt/floppy/boot <br>
# mkdir /mnt/floppy/boot/grub <br>
# cp /boot/grub/stage1 /mnt/floppy/boot/grub <br>
# cp /boot/grub/stage2 /mnt/floppy/boot/grub <br>
再有一个步骤,就能得到可用的引导盘。 <br>
<br>
在linux bash中,从 root 用户运行“grub”,该程序非常有趣并值得注意,因为它实际
上是 GRUB 引导装入器的半功能性版本。尽管 linux 已经激活并正在运行,您仍可以运行
GRUB 并执行某些任务,而且其界面与使用 GRUB 引导盘或将 GRUB 安装到硬盘 MBR 时看到
的界面(即GRUB控制台)完全相同。 <br>
在 grub> 提示符处,输入:<br>
grub> root (fd0)<br>
grub> setup (fd0)<br>
grub> quit<br>
现在,引导盘完成了。<br>
<br>
如果要把GRUB装到硬盘上,也很容易。这个过程几乎与引导盘安装过程一样。首先,需要
决定哪个硬盘分区将成为 root GRUB 分区。在这个分区上,创建 /boot/grub 目录,并将
stage1 和 stage2 文件复制到该目录中,可以通过重新引导系统并使用引导盘, 或者使用驻
留版本的 GRUB 来执行后一步操作。在这两种情况下,激活 GRUB,并用 root 命令指定root
分区。例如,如果将 stage1 和 stage2 文件复制到 hda5 的 /boot/grub 目录中,应输入
"root (hd0,4)"。接着,决定在哪里安装 GRUB -- 在硬盘的 MBR,或者如果与 GRUB一起使用
另一个“主”引导装入器,则安装在特定分区的引导记录中。如果安装到 MBR,则可以指定
整个磁盘而不必指定分区,如下(对于 hda): <br>
grub> setup (hd0) <br>
如果要将 GRUB 安装到 /dev/hda5 的引导记录中,应输入: <br>
grub> setup (hd0,4) <br>
现在,已安装 GRUB。引导系统时,应该立即以GRUB的控制台方式结束(如果安装到MBR)。
现在,应创建引导菜单,这样就不必在每次引导系统时都输入那些命令。<br>
</FONT><br>
</TD>
</TR>
<TR>
<TD colSpan=2><FONT
class=middlefont></FONT><BR>
<FONT
class=normalfont>全文结束</FONT> </TD>
</TR>
<TR>
<TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2
height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top width="20%"
background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2>
<DIV align=center>
<table class=tableoutline cellspacing=1 cellpadding=4
width="100%" align=center border=0>
<tr class=firstalt>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
<font class=normalfont><b>所有分类</b></font></td>
</tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td> </tr> </table></td></tr> </table>
</DIV></TD></TR>
<TR vAlign=top>
<TD width="80%">
<DIV align=center><BR>
</DIV>
</TD></TR></TBODY></TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee
border=0><TBODY>
<TR>
<TD width="50%">
<P><FONT class=middlefont>版权所有 © 2004 <A
href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
违者必究. </FONT></P>
</TD>
<TD width="50%">
<DIV align=right><FONT class=middlefont>Powered by: <A
href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
</TD></TR></TBODY></TABLE>
<CENTER></CENTER></TD></TR>
</TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -