linux系统一键安装6,CentOS 6.5 PXE一键安装Linux操作系统

#安装配置DHCP

yum -y install dhcp

cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf

vim /etc/dhcp/dhcpd.conf

subnet 192.168.3.0 netmask 255.255.255.0 {

range 192.168.3.100 192.168.3.200;

option domain-name-servers server.example.com;

option domain-name "8.8.8.8";

option routers 192.168.3.1;

option broadcast-address 192.168.3.255;

next-server 192.168.3.100;

filename "pxelinux.0";

default-lease-time 60000;

max-lease-time 720000;

}

service dhcpd start

chkconfig dhcpd on

#配置xinetd服务器

yum -y install syslinux tftp-server

vim /etc/xinetd.d/tftp

disable=no

service xinetd start

chkconfig xinetd on

#拷贝引导文件

cd /var/lib/tftpboot

cp /mnt/isolinux/* .

cp /usr/share/syslinux/pxelinux.0 .

mkdir pxelinux.cfg

cd pxelinux.cfg

cp /mnt/isolinux/isolinux.cfg ./default

vim default

label Install RHEL6.5

kernel vmlinuz

append initrd=initrd.img ks=nfs:192.168.3.100:/var/lib/tftpboot/ks.cfg

#配置NFS服务

yum -y install nfs*

mkdir /rhel6

mount /dev/cdrom /rhel6

vim /etc/exports

/rhel6    192.168.3.0/24(rw,sync)

service nfs start

chkconfig nfs on

yum -y install system-config-kickstgart

system-config-kickstart#创建一键安装脚本

#手动写入脚本

#platform=x86, AMD64, or Intel EM64T

#version=DEVEL

# Firewall configuration

firewall --disabled

# Install OS instead of upgrade

install

# Use NFS installation media

nfs --server=192.168.3.100 --dir=/mnt

# Root password

rootpw --iscrypted $1$3X.jwnPp$90YJQkQsBqTdL4aPRsgKc/

# System authorization information

auth  --useshadow  --passalgo=sha512

# Use graphical install

graphical

firstboot --disable

# System keyboard

keyboard us

# System language

lang en_US

# SELinux configuration

selinux --enforcing

# Installation logging level

logging --level=info

# Reboot after installation

reboot

# System timezone

timezone --isUtc Asia/Shanghai

# Network information

network  --bootproto=dhcp --device=eth0 --onboot=on

# System bootloader configuration

bootloader --location=mbr

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart --all --initlabel

# Disk partitioning information

part /boot --fstype="ext4" --size=200

part / --fstype="ext4" --grow --size=1

%packages

@basic-desktop

@desktop-debugging

@desktop-platform

@fonts

@general-desktop

@graphical-admin-tools

@input-methods

@kde-desktop

@legacy-x

@remote-desktop-clients

@x11

%end

原文:http://shanqiangwu.blog.51cto.com/8067564/1653988

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值