亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 5328 | 回復(fù): 7
打印 上一主題 下一主題

【原創(chuàng)】kickstart實現(xiàn)全自動網(wǎng)絡(luò)安裝RHEL5 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2009-03-20 16:53 |只看該作者 |倒序瀏覽
參考了許多文檔,有官方的,也有他人的安裝文檔,同時也有自己的安裝心得。本文沒有太多的理論介紹,所以想了解其中各種原理可以Google相關(guān)資料。
介紹了http和NFS兩種網(wǎng)絡(luò)安裝方式,配置文件中的區(qū)別主要有兩處,下文都有提到。本人實驗時為HTTP方式。
本人測試環(huán)境:RHEL5U2
步驟:
1. 安裝http服務(wù):
我安裝的是RHEL5U2自帶apache rpm安裝包。httpd服務(wù)安裝后,假設(shè)web根目錄為WEB_HOME=/var/www/html,我的RHEL5U2放在/databackup/rhel5u2,可以創(chuàng)建一個鏈接文件到web根目錄里:

ln -s /databackup/rhel5u2 $WEB_HOME/

如果能在瀏覽器里瀏覽到rhel5u2的目錄,即在瀏覽器里輸入http://192.168.3.252/rhel5u2能列出安裝文件樹,接著:

2. 創(chuàng)建kickstart配置文件:
可以使用system-config-kickstart創(chuàng)建一個配置文件,另外可以使用/root/anaconda-ks.cfg作為原始文件,再根據(jù)你的需求加以修改。

# vi $WEB_HOME/ks5u2.cfg

以下為一個ks文件的范本,可根據(jù)自己需求定制。關(guān)鍵是要弄清楚每個命令的作用。對于每個命令的作用可參考redhat官方文檔:
http://www.redhat.com/docs/manua ... ced-deployment.html

# Kickstart file automatically generated by anaconda.

install
url --url http://192.168.3.252/rhel5u2
#nfs --server=192.168.3.252 --dir=/databackup/rhel5u2
key --skip
#key <your_install_number>
lang en_US.UTF-8
langsupport --default=en_US.UTF-8 zh_CN.UTF-8 en_US.UTF-8
keyboard us
rootpw --iscrypted $1$KkOV/KBQ$.MjH2HBd6kxGPxa6ebng20
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --disabled
timezone Asia/Shanghai
reboot
text
#network --bootproto=dhcp --device=eth0
#network --device=eth0 --bootproto=static --ip=192.168.3.29 --netmask=255.255.255.0 --gateway=192.168.3.1 \
--nameserver=202.96.209.5 --hostname=test06
bootloader --location=mbr
# 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
part /boot --fstype ext3 --size=100
part / --fstype ext3 --size=15000
part /databackup --fstype ext3 --size=10240
part swap --size=1024

%packages
@mysql
@development-libs
@development-tools
@editors
@system-tools
@text-internet
@core
@base
@legacy-software-support
@base-x
@chinese-support
@web-server
@server-cfg
@admin-tools
@graphical-internet
emacs
sysstat
iptraf
lynx
mesa-libGLU-devel
device-mapper-multipath
gtk+
xorg-x11-utils
xorg-x11-server-Xvfb
system-config-kickstart
imake
-bluez-hcidump
-zsh
-ksh
-words
-apmd
-fbset
-finger
-mlocate
-dhcpv6-client
-mozldap
-rsh
-zsh
-sysreport
-rp-pppoe
-unix2dos
-svrcore
-amtu
-nc
-bluez-utils
-bluez-gnome
-nss_ldap
-krb5-workstation
-stunnel
-dosfstools
-pcmciautils
-pam_ccreds
-pam_smb
-mtools
-microcode_ctl
-mlocate
-mdadm
-talk
-system-config-httpd
-sabayon
-system-config-lvm
-setroubleshoot
-system-config-netboot
-system-config-kdump
-system-config-rootpassword
-sendmail
-symlinks
-vnc
-xdelta
-openldap-clients
-ypbind
-eject
-setarch
-nc
-irda-utils
-tux
-webalize
-squid
%post
echo 12345678 | passwd root --stdin
useradd nianzong
echo 12345678 | passwd test01 --stdin
chkconfig --level 345 sshd on
for i in autofs bluetooth cups firstboot ip6tables iptables rhnsd xfs yum-updatesd sendmail \
atd portmap pcmcia irqbalance ; do chkconfig $i off ; done
##To see more info about kickstart option:
#http://www.redhat.com/docs/manua ... ced-deployment.html
#上面這個配置可以實現(xiàn)雙系統(tǒng)安裝,即如果你的硬盤原有一個系統(tǒng)如Windows2003,并且有足夠的未分配空間,
#這個例子可以自動將Linux系統(tǒng)安裝在未分配空間里;如果是新硬盤或者你不想硬盤保留有其他系統(tǒng),啟用
#clearpart --all命令即可。兩種安裝方式我都測試通過。

到這里如果沒什么意外的話,則可以實現(xiàn)半自動安裝了。你可以使用一張RHEL5安裝光盤進入引導(dǎo)畫面后,輸入:
linux ks=http://192.168.3.252/ks5u2.cfg
如果你安裝的發(fā)行版自帶的驅(qū)動能夠找到你的網(wǎng)卡,接下來就能自動安裝系統(tǒng)了,如果認(rèn)不到你的網(wǎng)卡,那這種方式就行不通了,呵呵。所以謂之曰
半自動,因為前提是要能夠支持你的網(wǎng)卡驅(qū)動。要想實現(xiàn)全自動安裝,還得繼續(xù)配置DHCP,PEX,TFTP.

3. DHCP:
# rpm -qa|grep dhcp
dhcp-3.0.5-13.el5
#To enable dhcp daemon after system start.
# chkconfig --level 345 dhcpd on

把客戶端機器的MAC地址寫入下列配置文件里,我的是vmware虛擬機作為客戶端,開機可以按F12從
網(wǎng)絡(luò)啟動:

Here is my dhcpd.conf:

# cat /etc/dhcpd.conf
#---------------------------------/etc/dhcpd.conf------------------------------------#
ddns-update-style interim;
ignore client-updates;
deny unknown-clients;
#not authoritative;

subnet 192.168.3.0 netmask 255.255.255.0 {

# --- default gateway
        option routers                  192.168.3.1;
        option subnet-mask              255.255.255.0;
        option ip-forwarding            false;  # No IP forwarding
# --    option mask-supplier    false;  # Don't respond to ICMP Mask req
        option domain-name-servers      192.168.3.1;
        option time-offset              -18000; # Eastern Standard Time
        range dynamic-bootp 192.168.3.24 192.168.3.26;
        default-lease-time 21600;
        max-lease-time 43200;
group {
  next-server 192.168.3.252;          # name of your TFTP server
  filename "pxelinux.0";              # name of the bootloader program

  host node1 {
        hardware ethernet 00:0C:29:54:89:79;
        fixed-address 192.168.3.25;
  }
  host node2 {
        hardware ethernet 00:0C:29:54:89:80;
        fixed-address 192.168.3.26;
  }
}
}
#---------------------------------/etc/dhcpd.conf------------------------------------#

4. TFTP:
[root@localhost ~]# rpm -qa|grep tftp
tftp-server-0.42-3.1

# chkconfig --level 345 tftp on
# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
# cp /databackup/rhel5u2/images/pxeboot/initrd.img /tftpboot/initrd-as5u2.img
# cp /databackup/rhel5u2/images/pxeboot/vmlinuz /tftpboot/vmlinuz-as5u2
# mkdir /tftpboot/pxelinux.cfg
# cp /databackup/rhel5u2/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
# cp /databackup/rhel5u2/isolinux/*.msg /tftpboot/


The TFTP server directory /tftpboot should look like this:

[root@localhost tftpboot]# ls -p
boot.msg     initrd-as5u2.img  param.msg   pxelinux.cfg/  snake.msg
general.msg  options.msg       pxelinux.0  rescue.msg     vmlinuz-as5u2

[root@localhost tftpboot]# ls -p pxelinux.cfg/
default
                  



5. PEXlinux:
PXE can load a program into the client's memory and start it. I found it the easiest to manage,
if I first load a bootloader into the clients. The bootloader then loads its configuration file
via TFTP from the next-server(tftpsrv in the dhcpd.conf file example above).
The bootloader configuration file determines whether a client boots from its local hard disk
or over the network.

Here are example configuration files for my case:

default local
prompt 1
timeout 30
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
  kernel vmlinuz
  append initrd=initrd.img
label text
  kernel vmlinuz
  append initrd=initrd.img text
label ks
  kernel vmlinuz
  append ks initrd=initrd.img
label local
  localboot 0
label memtest86
  kernel memtest
  append -
label netinstall
  kernel vmlinuz-as5u2
  append ks=http://192.168.3.252/ks5u2.cfg initrd=initrd-as5u2.img

NFS方式安裝則為:
ks=nfs:192.168.3.252:/var/www/html/ks5u2.cfg

修改/tftp/boot.msg:
注意cat和vi的顯示是不一樣的,vi編輯的時候不要去修改那些特殊的字符,添加行時復(fù)制即可。

##---------------/tftpboot/boot.msg-------------------------------------------------#

splash.lss

-  To boot from local, press the 01<ENTER>07 key.

-  To install or upgrade in graphical mode, press the 01linux <ENTER>07 key.

-  To install or upgrade in text mode, type: 01linux text <ENTER>07.

-  To install RHEL AS5U2 automaticaly from network , type: 01netinstall <ENTER>07.

-  Use the function keys listed below for more information.

0f[F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]07

##---------------/tftpboot/boot.msg--------------------------------------------------#



kickstart參考文檔:
http://www.redhat.com/docs/manua ... ced-deployment.html

能申請加個精華么,呵呵。

[ 本帖最后由 nianzong 于 2009-7-7 17:23 編輯 ]

論壇徽章:
0
2 [報告]
發(fā)表于 2009-03-24 16:53 |只看該作者
好,樓主辛苦了

論壇徽章:
0
3 [報告]
發(fā)表于 2009-03-25 15:04 |只看該作者
樓主有心,多謝。

論壇徽章:
6
丑牛
日期:2013-09-17 00:18:40未羊
日期:2013-10-31 12:10:47午馬
日期:2013-12-07 01:58:50水瓶座
日期:2013-12-24 22:43:12水瓶座
日期:2014-03-15 21:12:13操作系統(tǒng)版塊每日發(fā)帖之星
日期:2016-08-07 06:20:00
4 [報告]
發(fā)表于 2009-03-30 15:33 |只看該作者
提示: 作者被禁止或刪除 內(nèi)容自動屏蔽

論壇徽章:
0
5 [報告]
發(fā)表于 2009-03-30 18:04 |只看該作者
樓上哥們,不必后悔了,我發(fā)了不也沒加精么,本來還想加點東西完善一下,都沒有動力了,呵呵
或許技術(shù)含量低了吧

論壇徽章:
0
6 [報告]
發(fā)表于 2009-04-07 23:21 |只看該作者
樂于分享是一種美德。

呵呵。

論壇徽章:
0
7 [報告]
發(fā)表于 2009-04-30 11:52 |只看該作者
正好我剛接觸這個,感謝樓主分享

論壇徽章:
0
8 [報告]
發(fā)表于 2009-04-30 12:34 |只看該作者
sharing spirit...
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP