GNU GRUB 2 是相对于其前身GNU GRUB LEGACY(GNU GRUB 0.97)而言的。目前仍处于不断开发阶段,最新版本为:grub-1.97.1.tar.gz-2009-11-09
基本知识
设备名:(hdm):m为从0开始,表示第一个硬盘
设备分区:(hdm,n):m为从0开始,表示第一个硬盘。在grub 2 中,n从1开始,表示第一个分区,而不再是传统grub 的0。据me的分析:此举是为了统一 和命令 liunx 中对 root参数的分区表示??!
GRUB 2和 GRUB LEGACY 的 命令区别
- kernel命令被弃用,被linux、linux16、multiboot替换
- 添加了变量的概念:之前很多的命令被设置相应的变量的方式替换,最明显的有:root、default、debug;与之配合,添加了:set、unset命令
- 添加了模块的概念:配合的命令有:insmod、rmmod、lsmod
- 添加虚拟设备支持:loopback
- 减少了网络支持功能:
- 增加了文件处理功能:ls、search
- 规范了命令、变量的命名:如color命令被两个新的变量menu_color_normal 和 menu_color_highlight 替换
Command |
GRUB Legacy |
GRUB 2 |
Comments |
Group |
yes |
yes |
|
||
yes |
yes |
|
||
yes |
no |
network support is missing |
||
yes |
yes |
|
||
yes |
yes |
ex. of use chainloader (hd0,1)+1 |
||
yes |
yes |
|
||
yes |
replaced |
now two variables (menu_color_{normal,highlight}) |
||
yes |
yes |
default file is /grub.cfg |
Menu only |
|
yes |
replaced |
now a variable |
||
yes |
yes |
now a variable |
||
yes |
replaced |
replaced with loopback |
||
yes |
no |
network support is missing |
||
yes |
no |
maybe useless |
||
yes |
replaced |
replaced by lsmmap |
||
yes |
no |
unnecessary |
||
yes |
replaced |
now a variable |
Menu only |
|
yes |
replaced |
replaced with search |
||
yes |
no |
how useful? "debug" variable should be enough |
||
yes |
no |
ls should suffice |
||
yes |
yes |
|
||
yes |
yes |
|
||
yes |
replaced |
see Hiddenmenu |
Menu only |
|
yes |
replaced |
Now a part of parttool |
||
yes |
no |
network support is missing |
||
yes |
no |
useless |
||
yes |
yes |
|
||
insmod |
no |
yes |
Insert a module |
|
yes |
no |
unnecessary |
||
yes |
no |
useless |
||
yes |
replaced |
replaced with multiboot, linux, etc. |
||
keystatus |
no |
yes |
Check key modifier status |
|
linux |
no |
yes |
Load a 32-bit linux kernel |
|
linux16 |
no |
yes |
Load a 16-bit zImage (Memtest86+) |
|
yes |
replaced |
Implemented differently |
||
loopback |
no |
yes |
Make a device from a file |
|
ls |
no |
yes |
|
|
lsmod |
no |
yes |
List modules |
|
yes |
replaced |
Now a part of parttool |
||
yes |
replaced |
replaced by drivemap |
||
yes |
no |
should be implemented as a utility |
||
yes |
yes |
|
||
yes |
no |
should be merged into module |
||
multiboot |
no |
yes |
Load a multiboot kernel |
|
yes |
replaced |
now a variable |
||
yes |
no |
Usefull to create/manage partitions without additional programs |
||
yes |
replaced |
Now a part of parttool |
||
yes |
yes |
Required for security |
||
yes |
no |
how useful? |
||
yes |
no |
synonym of halt or reboot? |
||
yes |
no |
used? |
||
yes |
replaced |
replaced with dump |
||
yes |
yes |
|
||
rescue |
no |
yes |
Enter rescue mode |
|
rmmod |
no |
yes |
Remove a module |
|
yes |
replaced |
now a variable |
||
yes |
no |
useless |
||
yes |
replaced |
replace by load_env/save_env |
||
no |
yes |
Search devices by a file or a filesystem label |
||
yes |
yes |
|
||
set |
no |
yes |
Set a variable |
|
yes |
no |
useful |
||
yes |
no |
unnecessary |
||
yes |
yes |
timeout support is missing |
||
yes |
yes |
not completed yet |
||
yes |
no |
how useful? |
||
yes |
replaced |
replaced with videotest (there is also vbetest command for vbe specifics) |
||
yes |
no |
network support is missing |
||
yes |
yes |
|
Menu only |
|
yes |
yes |
shortcut support would be nice |
Menu only |
|
yes |
replaced |
Now a part of parttool |
||
unset |
no |
yes |
Unset a variable |
|
yes |
no |
evil necessity! |
||
yes |
replaced |
replaced with vbeinfo |