前言*
KickStart很多運維人員都非常熟悉,我們大多數都用它來實現自動安裝系統,常見的用自動安裝RedHat Linux,最近由於業務需求,需要安裝Ubuntu,跟Redhat Linux還是有一些區別,記錄安裝步驟,供大家相互交流和學習!
一、環境及軟件
系統:CentOS 6.0、Ubuntu 12.04
軟件:KickStart、PXE、HTTPd、TFTPp、DHCP
二、正式安裝
本環境是基於在CentOS系統上搭建KickStart Ubuntu自動安裝服務端。
在服務器端執行:yum install dhcp* tftp* httpd* -y
安裝完後然後配置
1、配置ftfp:
- # default: off
-
- # description: The tftp server serves files using the trivial file transfer \
-
- # protocol. The tftp protocol is often used to boot diskless \
-
- # workstations, download configuration files to network-aware printers, \
-
- # and to start the installation process for some operating systems.
-
- service tftp
-
- {
-
- disable = no
-
- socket_type = dgram
-
- protocol = udp
-
- wait = yes
-
- user = root
-
- server = /usr/sbin/in.tftpd
-
- server_args = -s /var/lib/tftpboot
-
- per_source = 11
-
- cps = 100 2
-
- flags = IPv4
-
- }
把disable=yes改成disable=no即可!
安裝完tftp後,默認在/根目錄會生成/tftpboot文件夾,如果沒有請鏈接ln –s /var/lib/tftboot /即可。
掛載ubuntu12.04.iso文件
Mount /dev/cdrom /mnt &&cp /mnt/install/netboot/* /tftboot/下
然後修改vi /tftboot/ubuntu-installer/amd64/boot-screens/txt.cfg如下:
2、配置httpd、kickstart:
正如第二步截圖裡面有一個http://192.9.117.143/ubuntu/ks.cfg
默認安裝完後apache的發布目錄為/var/www/html
在/var/www/html下建立安裝源:
mkdir -p /var/www/html/ubuntu
然後將ubuntu光盤所有文件拷貝到/var/www/html/ubuntu下
cp -a /mnt/* /var/www/html/ubuntu
然後在/var/www/html/ubuntu目錄下新建ks.cfg文件,權限設置為chmod 777 ks.cfg
ks.cfg內容如下:
- install
- text
- lang en_US
- langsupport en_US
- keyboard us
- mouse
- timezone --utc Asia/Chongqing
- rootpw --disabled
- user tdt --fullname="tdt" --password wuguangke
- reboot
- url --url http://192.9.117.143/ubuntu
- bootloader --location=mbr
- zerombr yes
- clearpart --all --initlabel
- part /boot --fstype ext4 --size 200
- part swap --size 1024
- part / --fstype ext4 --size 1 --grow
- auth --useshadow --enablemd5
- network --bootproto=dhcp --device=eth0
- firewall --disabled
- skipx
- %packages
- penssh-server
- openssh-client
- nfs-kernel-server
- vim