下载中心 | 网站地图 | 站内搜索 | 加入收藏

安恒公司 / 技术文章 / 安恒公司网管员手记 / grub安装 --安恒网管员手记

2005-03-09 刘世伟  阅:    下页:
grub安装 --安恒网管员手记

在grub下, 磁盘的命*是bsd格式,

hd0是第*个盘,hd1第二个盘, hd1可能是hdb也可能是hdc也可能是sda

hd0,0是第*分区, hd0,0 是 /dev/hda1 hd0,1 是 /dev/hda2 .... hd0,5 是 /dev/hda6....

grub的有*个自己的命令界面,在启动时,安c可以进入, 或者在linux下直接执行grub出现命令界面.

grub下的命令支持tab补全. 也可以用tab对文件*进行补全.

在grub命令界面, 常用的几个命令有:

root (hd0,0) ;指定/dev/hda1做为根

kernel /boot/vmlinuz root=.... ;指定要调入的内核 以及参数

initrd /boot/initrd.img ;指定ramfs启动映像

boot ;开始启动

;上面几条可以从*个不能启动硬盘恢复启动.

setup ;此命令,可以用于在grub命令界面向硬盘安装grub启动支持.

faq:

问:我已经在用文件复制 在/dev/hdc6 建立了*个linux系统,如何让它可以启动?

答:将grub安装到mbr,以下命令,

#:grub
Probing devices to guess BIOS drives. This may take a long time.

GNU GRUB version 0.97 (640K lower / 3072K upper memory)

[ 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. ]
grub>root (hd1,5) ;指定根是/dev/hdc6
Filesystem type is ext2fs, partition type 0x83
grub>setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
....
grub>quit

直接用grub-install来安装:

mount /dev/hdc1 /2 ;*把要安装grub的根mount

grub-install /2 /dev/hdc ;装grub到hdc硬盘  

制作*个grub软盘:

grub-floppy /dev/fd0 

下页:   
Email给朋友 打印本文
版权所有·安恒公司 Copyright © 2004   www.anheng.com.cn   All Rights Reserved    
北京市海淀区*体南路9号 主语国际商务中心4号楼8层 (邮编100048) 电话:010-88018877