先將ks.cfg文件上傳到可以用http或者ftp可以訪問web或ftp服務器上。
安裝centos6.2步驟
進入安裝界面,按Esc鍵進入boot。
如圖所示,輸入如下內容:
開始自動安裝了,截圖如下:
安裝完後根據你的配置定義是否自動重啓
安裝以後查看系統網絡、ip地址等。
詳細ks.cfg配置如下,此處僅作簡單配置,請根據個人情況配置你的ks.cfg。
- # Kickstart file automatically generated by anaconda.
- #version=DEVEL
- #安裝
- install
- #選擇安裝方式cdrom
- cdrom
- #選擇語言
- lang en_US.UTF-8
- #選擇鍵盤類型
- keyboard us
- #設置你的ip地址和hostname設置後一般可以訪問了。#號部分爲如果你有幾塊網卡時,添加類似network配置即可。
- network --onboot yes --device eth0 --bootproto static --ip 192.168.1.145 --netmask 255.255.255.0 --gateway 192.168.1.1 --noipv6 --nameserver 192.168.1.1 --hostname winds
- #network --onboot yes --device eth1 --bootproto static --ip 192.168.1.146 --netmask 255.255.255.0 --gateway 192.168.1.1 --noipv6 --nameserver 192.168.1.1 --hostname winds
- #設置root用戶的密碼(此處爲123456)
- rootpw --plaintext 123456
- #對外開放防火牆程序ssh。
- firewall --service=ssh
- #爲系統設置驗證選項.這和在安裝後運行的authconfig命令相似..
- authconfig --enableshadow --passalgo=sha512
- # SELinux configuration 禁用selinux
- selinux --disabled
- #時區,亞洲上海
- timezone Asia/Shanghai
- bootloader --location=mbr --driveorder=sda --append=" rhgb crashkernel=auto quiet"
- #文本模式安裝時需要對初始化磁盤。使用--initlabel可初始化磁盤。
- #需要注意的是,如果用此ks.cfg安裝centos6.3時,需要自己再點一次初始化磁盤空間。
- clearpart --initlabel --all --drives=sda
- #設置分區,此處將剩餘空間分配給/目錄,具體如何分區請按照個人詳細情況劃分。
- part /boot --fstype=ext4 --size=512
- part / --fstype="ext4" --grow --size=1
- part swap --size=1024
- #最小化安裝
- %packages --nobase
- @core
- %end
- #安裝完成後自動重啓。
- reboot