标签:制作 dos .com 系统 shadow mbr 高级 表示 硬盘
[root@test88 ~]# mkdir /application/tools -p [root@test88 ~]# cd /application/tools/ [root@test88 tools]# ls CentOS-6.6-x86_64-bin-DVD1.iso [root@test88 tools]# mount -o loop CentOS-6.6-x86_64-bin-DVD1.iso /mnt/
[root@test88 ~]# mkdir -p /application/centos6 [root@test88 centos6]# rsync -avz --exclude=Packages/* --exclude=repodata/* /mnt/ /application/centos6/ #补充:rsync后面如果是/application/centos6,则会自动创建目录 #Packages和repodata里的内容后面要自定义添加
#root目录下默认有一个install.log文件,记录着系统安装安装的软件包 cd awk ‘/Installing/{print "rsync -az /mnt/Packages/"$2".rpm /application/centos6/Packages/"}‘ install.log | bash cd /mnt/Packages/ cp tree-1.5.3-2.el6.x86_64.rpm nmap-5.51-4.el6.x86_64.rpm lrzsz-0.12.20-27.1.el6.x86_64.rpm dos2unix-3.1-37.el6.x86_64.rpm telnet-0.17-48.el6.x86_64.rpm /application/centos6/Packages/
cd /application/centos6/ yum install -y createrepo cp /mnt/repodata/9e2ddcc42b44eb150ebc61dde29c997318d8330b92205b3dbb3a87bcc06d10be-c6-x86_64-comps.xml comps.xml createrepo -g comps.xml . #comps.xml 记录了包组内rpm包信息和依赖关系
vim /application/centos6/isolinux/ks.cfg #platform=x86, AMD64, or Intel EM64T #version=DEVEL # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use harddrive installation harddrive --partition=/dev/sda4 --dir=. # Root password rootpw --iscrypted $1$j2xUB1S7$9MW5sEYgcn3P/dqgF0/8L. # System authorization information auth --useshadow --passalgo=sha512 # Use graphical install text # System keyboard keyboard us # System language lang en_US.UTF-8 # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # Installation logging level logging --level=info # Reboot after installation reboot # System timezone timezone Asia/Shanghai # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part /boot --ondisk=/dev/sdb --asprimary --fstype="ext4" --size=200 part swap --ondisk=/dev/sdb --asprimary --fstype="swap" --size=1024 part / --ondisk=/dev/sdb --asprimary --fstype="ext4" --grow --size=1 %packages @base @compat-libraries @debugging @development tree nmap lrzsz dos2unix telnet %post echo "Welcome to the peter linux system" > /etc/motd %end
vim /application/centos6/isolinux/isolinux.cfg label linux menu label ^Install or upgrade an existing system menu default kernel vmlinuz append ks=hd:sda4:/isolinux/ks.cfg initrd=initrd.img
yum install -y mkisofs mkisofs -R -J -T -v -no-emul-boot -boot-load-size 4 -boot-info-table -V CS66ISO -b isolinux/isolinux.bin -c isolinux/boot.cat -o /application/CentOS-6.6-x86_64-peter.iso /application/centos6/
yum install -y isomd5sum implantisomd5 CentOS-6.6-x86_64-peter.iso checkisomd5 CentOS-6.6-x86_64-peter.iso #implantisomd5是向iso文件里植入md5值,checkisomd5是检查iso文件里的md5值
#这里还可以使用linux下的isohybrid生成混合iso,然后dd写入的办法制作启动U盘。
设置虚拟机--》添加磁盘--》添加物理磁盘
打开高级--》设置U盘为第一启动盘
启动虚拟机,即可自动安装
标签:制作 dos .com 系统 shadow mbr 高级 表示 硬盘
原文地址:http://www.cnblogs.com/Peter2014/p/7609107.html