第四步 执行脚本
#执行iso.sh脚本,自动生成镜像文件
[root@larrywen opt]# ./iso.sh
#如果出现以下信息表示操作成功
Total translation table size: 2048
Total rockridge attributes bytes: 403974
Total directory bytes: 622592
Path table size(bytes): 270
Done with: The File(s) Block(s) 1757479
Writing: Ending Padblock Start Block 1758031
Done with: Ending Padblock Block(s) 150
Max brk space used 3a1000
1758181 extents written (3433 MB)
#文件内容
[root@larrywen opt]# cat iso.sh
#!/bin/sh
#
# build CDlinux ISO image -- zxh(imzxh@yahoo.com)
MKISO=`which genisoimage 2>/dev/null` ||MKISO=`which mkisofs 2>/dev/null` || {
echo "Sorry, you don't have genisoimage or mkisofs installed."
exit 1
}
$MKISO -v -R -J -joliet-long -ucs-level 3 -input-charset utf8 \
-publisher "up14" -p "wgbno27@163.com" -V"rhel6.1_x86_64" \
-c boot.cat -hide boot.cat -b isolinux/isolinux.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-o /opt/rhel6.iso /opt/rhel6
第五步 安装系统
#新建虚拟机,配置的安装源选择刚才制作的镜像rhel6.iso
#出现安装界面后等待,大概60s,不需要其他任何操作,会自动跳到安装界面
#最后,我们以root用户登录,查看当前选择的包(MySQL & Web Server)对应的服务(mysqld & httpd)是否在运行,如果在,则证明刚才的安装后执行脚本执行成功
[root@localhost ~]# service httpd status
httpd (pid 1480) is running...
[root@localhost ~]# service mysqld status
mysqld (pid 1369) is running...
#还可以通过firefox验证http://192.168.1.12/ 可以看到一个测试页面注意把防火墙关闭
