准备:8G U盘,centos6.2mini系统,centos6.3mini系统,
下载软件:
下载软件:
http://download.gna.org/grub4dos/
http://download.gna.org/grubutil/
http://download.gna.org/grubutil/
下载
grub4dos-0.4.6a-2012-10-02.7z
grubinst-1.1-bin-w32-2008-01-01.zip
解压grub4dos-0.4.6a-2012-10-02.7z 把里面内容都copy到U盘中。
把grubinst-1.1-bin-w32-2008-01-01.zip 解压U盘中为了好看重命名为grubinst
进入grubinst目录,执行grubinst_gui.exe。
如上选择安装,后点退出。
设置menu.lst文件,样例可以在U盘目录下sample文件中拷贝。我设置如下:
grub4dos-0.4.6a-2012-10-02.7z
grubinst-1.1-bin-w32-2008-01-01.zip
解压grub4dos-0.4.6a-2012-10-02.7z 把里面内容都copy到U盘中。
![](https://s1.51cto.com/attachment/201211/143621870.jpg)
把grubinst-1.1-bin-w32-2008-01-01.zip 解压U盘中为了好看重命名为grubinst
进入grubinst目录,执行grubinst_gui.exe。
![](https://s1.51cto.com/attachment/201211/144010922.jpg)
如上选择安装,后点退出。
设置menu.lst文件,样例可以在U盘目录下sample文件中拷贝。我设置如下:
find --set-root --ignore-floppies /bootmgr
chainloader /bootmgr
savedefault --wait=2
title find and load CMLDR, the Recovery Console of Windows NT/2K/XP
fallback 3
find --set-root --ignore-floppies /cmldr
chainloader /cmldr
#####################################################################
# write string "cmdcons" to memory 0000:7C03 in 2 steps:
#####################################################################
# step 1. Write 4 chars "cmdc" at 0000:7C03
write 0x7C03 0x63646D63
# step 2. Write 3 chars "ons" and an ending null at 0000:7C07
write 0x7C07 0x00736E6F
savedefault --wait=2
title install Windows
find --set-root /win7/sources/setup.exe
chainloader /win7/bootmgr
title install Linux CentOS62
root (hd0,0)
kernel /CentOS62/vmlinuz repo=hd:/dev/sdb1:/CentOS62
initrd /CentOS62/initrd.img
title install Linux CentOS63
root (hd0,0)
kernel /CentOS63/vmlinuz repo=hd:/dev/sdb1:/CentOS63
initrd /CentOS63/initrd.img
title commandline
commandline
title back to dos
quit
title reboot
reboot
chainloader /bootmgr
savedefault --wait=2
title find and load CMLDR, the Recovery Console of Windows NT/2K/XP
fallback 3
find --set-root --ignore-floppies /cmldr
chainloader /cmldr
#####################################################################
# write string "cmdcons" to memory 0000:7C03 in 2 steps:
#####################################################################
# step 1. Write 4 chars "cmdc" at 0000:7C03
write 0x7C03 0x63646D63
# step 2. Write 3 chars "ons" and an ending null at 0000:7C07
write 0x7C07 0x00736E6F
savedefault --wait=2
title install Windows
find --set-root /win7/sources/setup.exe
chainloader /win7/bootmgr
title install Linux CentOS62
root (hd0,0)
kernel /CentOS62/vmlinuz repo=hd:/dev/sdb1:/CentOS62
initrd /CentOS62/initrd.img
title install Linux CentOS63
root (hd0,0)
kernel /CentOS63/vmlinuz repo=hd:/dev/sdb1:/CentOS63
initrd /CentOS63/initrd.img
title commandline
commandline
title back to dos
quit
title reboot
reboot
在U盘目录建立centos62,centos63和win7目录,把对应的iso镜像copy进去。
这样一个grub4的启动盘就做好了。
这里主要是menu.lst的设置,centos需要把 initrd.img ,p_w_picpaths和vmlinuz 先从镜像中解压出到对应目录。
win7是需要把整个镜像都解压到对应目录下的。
最后整个U盘的内容如下:
装系统时U盘启动,选择对应系统install。
这样一个grub4的启动盘就做好了。
这里主要是menu.lst的设置,centos需要把 initrd.img ,p_w_picpaths和vmlinuz 先从镜像中解压出到对应目录。
![](https://s1.51cto.com/attachment/201211/144815600.jpg)
win7是需要把整个镜像都解压到对应目录下的。
最后整个U盘的内容如下:
![](https://s1.51cto.com/attachment/201211/145215528.jpg)
装系统时U盘启动,选择对应系统install。
转载于:https://blog.51cto.com/angus717/1048238