一、制作启动安装U盘@H_404_1@
@H_404_1@
用UltraISO打开CentOS5.6镜像@H_404_1@
点击启动->写入硬盘映像->格式化 ,格式化成fat32格式@H_404_1@
点击启动->写入硬盘映像->写入@H_404_1@
打开U盘,删掉除isolinux和images外的所有文件和目录@H_404_1@
将CentOS5.6镜像拷贝到U盘根目录@H_404_1@
@H_404_1@
二、CentOS5.6安装启动@H_404_1@
@H_404_1@
BIOS设置为从U盘启动@H_404_1@
U盘一般为/dev/sdb@H_404_1@
安装好后第一次启动(如果已经拔掉U盘)可能需要将grub引导由root (hd1,0)改为root (hd0,0)才可以正常进入系统@H_404_1@
以下为永久更改grub使正常引导:@H_404_1@
[root@mfsmaster home]# /sbin/grub@H_404_1@
grub> find /grub/stage1 @H_404_1@
(hd1,0) @H_404_1@
@H_404_1@
如果提示Error 15: File not found,则尝试 find /boot/grub/stage1 或者 find stage1@H_404_1@
(hd1,0)代表的第二个硬盘的第一个分区,相应的(hd0,0)代表的就是第一个硬盘第一个分区,这一步其实就是告诉我们引导被写入了U盘中= =@H_404_1@
@H_404_1@
grub> root (hd0,0) @H_404_1@
Filesystem type is ext2fs,partition type 0x83 @H_404_1@
@H_404_1@
grub> setup (hd0) @H_404_1@
Checking if "/boot/grub/stage1" exists... no @H_404_1@
Checking if "/grub/stage1" exists... yes @H_404_1@
Checking if "/grub/stage2" exists... yes @H_404_1@
Checking if "/grub/e2fs_stage1_5" exists... yes @H_404_1@
Running "embed /grub/e2fs_stage1_5 (hd0)"... 15 sectors are embedded. @H_404_1@
succeeded @H_404_1@
Running "install /grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded @H_404_1@
Done. @H_404_1@
@H_404_1@
grub> reboot @H_404_1@
@H_404_1@
然后修改启动的 /boot/grub/menu.lst 或者 /boot/grub/grub.conf CentOS下这两个文件是绑定的,改一个即可@H_404_1@
@H_404_1@
[root@mfsmaster home]# vi /boot/grub/menu.lst @H_404_1@
@H_404_1@
# grub.conf generated by anaconda @H_404_1@
# @H_404_1@
# Note that you do not have to rerun grub after making changes to this file @H_404_1@
# NOTICE: You have a /boot partition. This means that @H_404_1@
# all kernel and initrd paths are relative to /boot/,eg. @H_404_1@
# root (hd1,0) @H_404_1@
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 @H_404_1@
# initrd /initrd-version.img @H_404_1@
#boot=/dev/sdb @H_404_1@
default=0 @H_404_1@
timeout=5 @H_404_1@
splashimage=(hd0,0)/grub/splash.xpm.gz @H_404_1@
hiddenmenu @H_404_1@
title CentOS (2.6.18-274.3.1.el5) @H_404_1@
root (hd0,0) @H_404_1@
kernel /vmlinuz-2.6.18-274.3.1.el5 ro root=/dev/VolGroup00/LogVol00 @H_404_1@
initrd /initrd-2.6.18-274.3.1.el5.img @H_404_1@
title CentOS (2.6.18-238.el5) @H_404_1@
root (hd0,0) @H_404_1@
kernel /vmlinuz-2.6.18-238.el5 ro root=/dev/VolGroup00/LogVol00 @H_404_1@
initrd /initrd-2.6.18-238.el5.img @H_404_1@
title Other @H_404_1@
rootnoverify (hd0,3) @H_404_1@
chainloader +1 @H_404_1@
把当中的(hd1,0)都改成(hd0,0),splashimage=(hd0,0)/grub/splash.xpm.gz 这个是开机引导背景图片的位置,改不改都关系不大,重启CentOS就可以正常启动了@H_404_1@