免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1978 | 回复: 3
打印 上一主题 下一主题

简单的Linux无人职守安装 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-02-01 21:32 |只看该作者 |倒序浏览
小弟我是一个Linux菜鸟,前些天,和一个朋友说起了LINUX下的无人职守安装,朋友有点不相信还可以这样做系统的,本人决定实验一次给他看看,呵呵,不过我也不是很熟,周末刚好有时间,拿出来练练手,虽然出了一些问题,最后还是成功了,现在和大家分享一下,小弟技术有限,有不清楚的地方还请大家海涵。

环境:  服务器(RHEL5),采用DHCP,NFS,和TFTP安装,所有服务都在同一台机子上,IP---->192.168.1.11/255.255.255.0
                客户端(需安装系统的机子),用两台虚拟机实现,所装系统也是RHEL5

一:生成ks.cfg配置文件
                运行system-config-kickstar,图行界面配置,大家都知道怎么做。
                我的ks.cfg配置文件内容如下:   
#platform=x86, AMD64, 或 Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --none
# Use graphical install
graphical
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang zh_CN
key --skip
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=192.168.1.11 --dir=/mnt
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$sUvSsRx3$yQzIfw7pgABOlHNosj/Ts0

# SELinux configuration
selinux --disabled
# System timezone
timezone  America/New_York
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig  --defaultdesktop=GNOME --depth=8 --resolution=1024x768 --startxonboot
# Disk partitioning information
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=100
part swap --bytes-per-inode=4096 --fstype="swap" --size=1024
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=5000
%packages
@office
@development-libs
@editors
@system-tools
@gnome-software-development
@text-internet
@x-software-development
@gnome-desktop
@dialup
@core
@base
@java
@java-development
@openfabrics-enterprise-distribution
@legacy-software-support
@base-x
@chinese-support
@graphics
@ruby
@printing
@kde-software-development
@kde-desktop
@server-cfg
@sound-and-video
@admin-tools
@development-tools
@graphical-internet
perl-Convert-ASN1
emacs
festival
audit
mesa-libGLU-devel
kexec-tools
fipscheck
device-mapper-multipath
xorg-x11-utils
xorg-x11-server-Xnest
xorg-x11-server-Xvfb
libsane-hpaio
imake





二:安装DHCP服务
        yum -y install dhcp
        cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf ------>拷贝DHCP服务的模板主配置文件
        vim /etc/dhcpd.conf  如下:
        ddns-update-style interim;
        ignore client-updates;
        next-server     192.168.1.11;
        filename        "/pxelinux.0";
        subnet 192.168.1.0 netmask 255.255.255.0 {
        # --- default gateway
        option routers                  192.168.1.11;
        option subnet-mask              255.255.255.0;
        option nis-domain               "domain.org";
        option domain-name              "domain.org";
        option domain-name-servers      192.168.1.11;
        option time-offset              -18000; # Eastern Standard Time
        range dynamic-bootp 192.168.1.128 192.168.1.254;
        default-lease-time 21600;
                  max-lease-time 43200;
                                                                                        }
                启动服务  service dhcpd restart

三:NFS服务
        vim /etc/exports 如下:
                /mnt    *(rw)  ----------->此目录为挂载系统ISO镜像文件的目录,共享
                /mnt1   *(rw)  ----------->此目录为存放ks.cfg的目录,共享
               
                mount -o loop /root/RHEL5U3.iso /mnt ----------->挂载光盘镜像文件
                cp /root/ks.cfg /mnt1   
                启动服务  service nfs restart

四:TFTP服务
        yum -y install tftp-server
        mkdir /tftpboot/pxelinux.cfg/
        cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
        cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
        cp /mnt/isolinux/vmlinuz /tftpboot/
        cp /mnt/isolinux/initrd.img /tftpboot/
        启动tftp服务       
                        chkconfig tftp on
                        service xinetd restart

五:vim /tftpboot/pxelinux.cfg/default 文件,内容如下(没有全部,只是其中有用的一部分)
                default linux
                prompt 1
                timeout 10  
                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 text ks=nfs:192.168.1.11:/mnt1/ks.cfg  
                label text
                                 kernel vmlinuz
                          append initrd=initrd.img text

六:服务端配置完成,启动客户机,进行安装。

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2010-02-01 21:42 |只看该作者
还是百湖那个好

论坛徽章:
0
3 [报告]
发表于 2010-02-03 22:54 |只看该作者
我看直接用ghost更好

论坛徽章:
5
寅虎
日期:2015-01-20 09:16:52亥猪
日期:2015-01-21 14:43:44IT运维版块每日发帖之星
日期:2015-12-17 06:20:00每日论坛发贴之星
日期:2015-12-17 06:20:00每周论坛发贴之星
日期:2015-12-20 22:22:00
4 [报告]
发表于 2010-02-04 09:46 |只看该作者
看看,

谢楼主...
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP