步驟
1、mount /dev/sr0 /media/
2、安裝所需要的軟件
安裝并配置tftp服務(wù)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
yum install tftp tftp-server vsftpd dhcp syslinux nfs-utils vim /etc/xinetd .d /tftp 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 } |
配置dhcp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# dhcpd.conf # # Sample configuration file for ISC dhcpd # allow booting; allow bootp; # A slightly different configuration for an internal subnet. subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.50 192.168.1.60; option domain-name-servers KangChangWei; option domain-name "KangChangWei"; option routers 192.168.1.1; default-lease-time 600; max-lease-time 7200; filename "pxelinux.0"; next-server 192.168.1.101; } |
以上IP可以根據(jù)自己所在的網(wǎng)絡(luò)修改
3、復(fù)制所需要的啟動(dòng)文件
1
2
3
4
5
6
7
|
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot cp /media/images/pxeboot/initrd.img /var/lib/tftpboot/ cp /media/images/pxeboot/vmlinuz /var/lib/tftpboot/ mkdir /var/lib/tftpboot/pxelinux.cfg cp /media/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default |
編輯
Vim /var/lib/tftpboot/pxelinux.cfg/default
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
default linux #default vesamenu.c32 prompt 1 timeout 600 display boot.msg menu background splash.jpg menu title Welcome to CentOS 6.5! menu color border 0 #ffffffff #00000000 menu color sel 7 #ffffffff #ff000000 menu color title 0 #ffffffff #00000000 menu color tabmsg 0 #ffffffff #00000000 menu color unsel 0 #ffffffff #00000000 menu color hotsel 0 #ff000000 #ffffffff menu color hotkey 7 #ffffffff #ff000000 menu color scrollbar 0 #ffffffff #00000000 label linux menu label ^Install or upgrade an existing system menu default kernel vmlinuz append initrd=initrd.img ks=ftp://192.168.1.101/pub/ks.cfg label vesa menu label Install system with ^basic video driver kernel vmlinuz append initrd=initrd.img xdriver=vesa nomodeset label rescue menu label ^Rescue installed system kernel vmlinuz append initrd=initrd.img rescue label local menu label Boot from ^local drive localboot 0xffff label memtest86 menu label ^Memory test kernel memtest append - |
4、共享光盤
1
2
|
vim /etc/export /media *(ro,sync) |
啟動(dòng)nfs服務(wù)
1
2
3
4
5
6
7
8
9
10
11
12
|
[root@kcw ~]# /etc/init.d/rpcbind restart 停止 rpcbind: [確定] 正在啟動(dòng) rpcbind: [確定] [root@kcw ~]# /etc/init.d/nfs restart 關(guān)閉 NFS 守護(hù)進(jìn)程: [確定] 關(guān)閉 NFS mountd: [確定] 關(guān)閉 NFS 服務(wù): [確定] Shutting down RPC idmapd: [確定] 啟動(dòng) NFS 服務(wù): [確定] 啟動(dòng) NFS mountd: [確定] 啟動(dòng) NFS 守護(hù)進(jìn)程: [確定] 正在啟動(dòng) RPC idmapd: [確定] |
查看nfs輸出
1
2
3
|
[root @ kcw ~] # showmount -e localhost Export list for localhost : /media * |
生成ks.cfg文件安裝工具
1
|
[root@kcw ~]# yum install system-config-kickstart |
然后運(yùn)行
1
|
system-config-kickstart |
來修改頁面得到自己安裝的客戶端
我這里省略。。
這有個(gè)做好的ks.cfg
內(nèi)容如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#platform=x86, AMD64, or Intel EM64T #version=DEVEL key --skip # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use network installation nfs --server=192.168.1.101 --dir=/media # Root password rootpw --iscrypted $1$9ElloIHk$pO.NfjND/6K88z3CiIvPc. # Network information network --bootproto=dhcp --device=eth0 --onboot=on # System authorization information auth --useshadow --passalgo=md5 # Use text mode install text # System keyboard keyboard us # System language lang zh_CN # 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 # Disk partitioning information part swap --size 2048 part /boot --size 200 part pv.01 --size 30000 volgroup vol0 pv.01 logvol / --vgname=vol0 --size=25000 --name=root #logvol /home --vgname=vol0 --size=500 --name=home %post #wget ftp://192.168.1.101/pub/yum.repo -P /etc/yum.repos.d/ %packages @ Desktop @ Console internet tools @ Desktop Platform @ Development Tools @ General Purpose Desktop @ Graphical Administration Tools @ Internet Browser @ Network file system client @ Printing client @ X Window System @ Chinese Support |
注意我這塊root密碼是redhat
我這里分區(qū)時(shí)lvm分區(qū)根據(jù)你的需求也可以修改
然后把ks.cfg放到你的vsftpd默認(rèn)可以訪問的目錄里
即:
1
2
3
4
5
|
[root@kcw ~]# cd /var/ftp/pub/ [root@kcw pub]# ls ks.cfg [root@kcw pub]# pwd /var/ftp/pub |
注意先測試你的這個(gè)文件能不能訪問打開IE
輸入ftp://192.168.1.101/pub/ks.cfg
看能否看到內(nèi)容!
做完重啟dhcp vsftpd xine xinetd nfs
然后重新開臺(tái)電腦開機(jī)設(shè)置從網(wǎng)卡引導(dǎo)看能否啟動(dòng)成功并且自動(dòng)安裝
我這塊等待默認(rèn)600秒 自動(dòng)安裝
開機(jī)引導(dǎo)到boot:時(shí)按回車安裝