您的位置:首页 > 运维架构 > Linux

制作grub 0.97启动盘

2012-01-30 14:42 274 查看
前提:

U盘:需要MBR和至少一个分区,假设u盘boot分区为sdb1

操作系统:Centos 6

step1.将grub写入u盘

#写入bootsector
[root@localhost ~]# grub-install --root-directory=/mnt/extend/usbdisk /dev/sdb1
Probing devices to guess BIOS drives. This may take a long time.
Installation finished. No error reported.
This is the contents of the device map /mnt/extend/usbdisk/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0)	/dev/fd0
(hd0)	/dev/sda
(hd1)	/dev/sdb

#写入MBR
[root@localhost ~]# 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,0)
root=(hd1,0)
 Filesystem type is fat, partition type 0x83
grub> setup (hd1)
setup (hd1)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/fat_stage1_5" exists... yes
 Running "embed /boot/grub/fat_stage1_5 (hd1)"...  25 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd1) (hd1)1+25 p (hd1,0)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done.


step2.下载grub4dos到U盘boot分区

下载地址:http://download.gna.org/grub4dos/,复制其中的grub.exe到U盘boot分区的根目录

Reference:

Grub 0.97 Documentation:http://www.gnu.org/software/grub/manual/legacy/

Grub4dos Guide:http://diddy.boot-land.net/grub4dos/Grub4dos.htm
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息