echo '- - -' > /sys/class/scsi_host/host2/scan
mount /dev/sr0 /var/www/html/centos7
mount /dev/sr1 /var/www/html/centos6
mount /dev/sr2 /var/www/html/rhel5
也可以把挂载写入/etc/fstab文件。
4.编辑安装引导文件ks.cfg
可以简单编辑root家目录下的anaconda-ks.cfg,然后把三个系统的引导文件复制到本机的/var/html/www/下。并注意此文件权限为644。
centos7的.cfg文件参考如下:
[root@centos7 ~]# cat /var/www/html/ks7.cfg
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
url --url=http://192.168.23.7/centos7
# Use graphical install
#graphical
text
reboot
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --bootproto=dhcp --device=ens33 --onboot=on --ipv6=auto --activate
network --hostname=centos7.magedu.com
# Root password
rootpw --iscrypted $6$/BVcMpadhqgy0l4J$FQ1fqYddKm1zqjxEkXn3XctFXiJ2LLWnVfRPi1u1oF6Wx5ebfKwe.8W0wHfF7oxeqDLJbkJJYTnry7W9o/6KP/
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp
# X Window System configuration information
xconfig --startxonboot
# System bootloader configuration
zerombr
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# Partition clearing information
clearpart --all --initlabel --drives=sda
# Disk partitioning information
part / --fstype="xfs" --ondisk=sda --size=47683
part /boot --fstype="xfs" --ondisk=sda --size=953
part swap --fstype="swap" --ondisk=sda --size=3814
part /app --fstype="xfs" --ondisk=sda --size=47683
%packages
@base
@core
@dial-up
@fonts
@guest-agents
@network-file-system-client
@networkmanager-submodules
@x11
%end
%addon com_redhat_kdump --disable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=50 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=50 --notstrict --nochanges --notempty
pwpolicy luks --minlen=6 --minquality=50 --notstrict --nochanges --notempty
%end
centos6的.cfg参考如下:
[root@centos7 html]# cat /var/www/html/ksdir/ks6.cfg
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
url --url=http://httpsrv/centos/6
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --iscrypted $6$CxpwSUg0oCIQZX52$0yfD8CXU4Q.60uYDqSHWz5.1enxwnhrv9esPRYSix4U1cWoaN.hOpgSLqCd22yjRdEhAwwUdxAIbn.mxMn.kx/
firewall --disable
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone Asia/Shanghai
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
zerombr
clearpart --all
reboot
text
part /boot --fstype=ext4 --size=1000
part / --fstype=ext4 --size=100000
part /app --fstype=ext4 --size=50000
part swap --size=2048
%packages
@base
@core
@basic-desktop
@desktop-platform
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@internet-applications
@internet-browser
@network-file-system-client
@office-suite
@print-client
@remote-desktop-clients
@server-policy
@workstation-policy
@x11
mtools
pax
%endrhel5的.cfg文件如下:
# Kickstart file automatically generated by anaconda.
install
url --url=http://192.168.23.7/rhel5
key --skip
lang zh_CN.UTF-8
keyboard us
xconfig --startxonboot
network --device eth0 --bootproto dhcp --hostname rhel5.4.centos.com
rootpw --iscrypted $1$YntMaKAR$vXCZ6J8hGwcRtfso7lk9o.
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --disabled
timezone Asia/Shanghai
bootloader --location=mbr --driveorder=sda --append="rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
#clearpart --linux
zerombr
clearpart --all
reboot
text
part /boot --fstype ext3 --size=100
part / --fstype ext3 --size=51200
part /app --fstype ext3 --size=10240
part swap --size=1024
%packages
@admin-tools
@base
@core
@dialup
@editors
@graphical-internet
@graphics
@legacy-software-support
@office
@printing
@text-internet
@base-x
kexec-tools
fipscheck
sgpio
emacs
libsane-hpaio
xorg-x11-utils
xorg-x11-server-Xnest