GRUB 使用备忘
GRUB 使用备忘
lu_yi_ming(_at_)sina.com
2004.9
GRUB 是个好东西!经常用的东西记下来,想不起来的时候看看。
--------------------------------------------------
盘符
硬盘:(hd0)、(hd1)
软盘:(fd0)
光盘:未知
USB盘:未知
硬盘分区
(hd0,1)、(hd0,6)
文件路径
(hd0,1)/boot/grub/splash.xpm.gz
(hd0,6)/boot/grub/grub.conf
查找文件
find /boot/grub/grub.conf
显示文件内容
cat (hd0,6)/boot/grub/grub.conf
技巧:显示启动菜单、显示 /etc/fatab 文件内容
设置当前默认使用的硬盘分区
root (hd0,6)
此 root 与 linux 的 root "/" 不是一回事儿
设置好后,其他命令可以省去分区路径(hd0,6)
恢复(安装)grub
root (hd..)
setup (hd0)
setup (hd0,6)
linux 启动后:grub-install /dev/hda
把一个内核文件读入内存
kernel (hd..)/boot/... ro root=...
把 linux 的 RAM 盘读入内存
initrd (hd..)/boot/..
启动已读入内存的操作系统
boot
启动一个 linux
root (hd..)
kernel /boot/vmliuz... ro root...
initrd /boot/initrd...
boot
技巧:用这个办法可以安装下载到硬盘上的其他 linux
在软盘上安装一个 grub
在 grub 中不行
linux 启动后:
# mke2fs /dev/fd0
# mount -t ext2 /dev/fd0 /mnt
# grub-install --root-directory=/mnt fd0
# umount /mnt
显示显卡图形能力
vbeprobe
测试显卡图形支持
test 0x151
test 792
注意:图形界面下测试后死机需要重启
更换背景图片
splashimage (hd..)/boot/grub/...xpm.gz
操作小技巧
TAB 键:命令或文件填写完整
上下方向键:重复命令
ESC 键:退出,回到菜单界面
命令帮助
help
help root
--------------------------------------------------
编译支持背景图片
http://ruslug.rutgers.edu/~mcgrof/grub-images/
Debian 好!
制作背景图片
用 gimp 设计一个 640 * 480 的图形文件,画一些东西,保存为 .xpm 文件 test.xpm
设定颜色数量为 14 :菜单:Image - Mode - Indexed
gzip test.xpm ,得到 test.xpm.gz