Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Kickstart to install CentOS automatically

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use Kickstart to automate the installation of CentOS". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use Kickstart to automate the installation of CentOS.

Preface

Because of the need to centrally deploy CentOS in the tide of x86 servers to build a Hadoop-based big data platform, I usually have more contact with SLES (SuSE Linux Enterprise Server) and have realized automatic installation using CD-ROM or PXE network based on Autoyast (specific implementation methods will be shared later). This time mainly through learning Kisckstart to achieve the simplest CD-ROM way to automatically install CentOS, and most of the online tutorials are not fully applicable to their own environment, this article will not repeat the related concepts of Kickstart, details can refer to the extension to read.

Kickstart is one of the most general automatic installation methods of Linux.

Environmental preparation

Customized system

CentOS-6.4-x86_64

Official download address-http://wiki.centos.org/Download

Install the package

Tips for surfing the Internet by agents, export http_proxy=ip:port

The code is as follows:

Yum-y install createrepo mkisofs

Production process

Directory structure

Copy the original mirror content of CentOS without any streamlining

The code is as follows:

Mkdir / mnt/centos

Mount / dev/sr0 / mnt/centos

Mkdir / tmp/iso

Cp-r / mnt/centos/* / tmp/iso

Add Kickstart profile

File path and installation method can be defined freely

The code is as follows:

Cd / tmp/iso/isolinux

# modify the boot, pay attention to the ks= section

Vi isolinux.cfg

Label linux

Menu label ^ Install or upgrade an existing system

Menu default

Kernel vmlinuz

Append initrd=initrd.img ks=cdrom:/isolinux/ks.cfg

# manually add Kickstart configuration files

Vi ks.cfg

# Kickstart file automatically generated by anaconda.

# version=DEVEL

# Install OS instead of upgrade

# means installation, not upgrade

Install

# Use text mode install

# text installation

Text

# Use network installation

# using network installation

# url-- url= ftp://ip/centos

# Local installation Use CDROM installation media

# install using CD

Cdrom

# Installation Number configuration

# if it is a RedHat system, you will be required to enter key, which is configured to skip. If you do not configure the installation, you will stop there and ask the user to enter key.

# key-skip

# System language

# language environment

# lang en_US.UTF-8

Lang zh_CN.UTF-8

# System keyboard

# Keyboard type

Keyboard us

# Network information

# Network configuration

# network-device eth0-bootproto dhcp-onboot yes

# Root password

# root password

Rootpw chinaums

# Firewall configuration

# disable firewall

Firewall-disabled

# SELinux configuration

# disable selinux

Selinux-disabled

# Run the Setup Agent on first boot

# disable the wizard for setting up the system on the first boot

Firstboot-disable

# System authorization information

# user authentication configuration. Useshadow: use local authentication.-- passalgo: password encryption algorithm.

Authconfig-enableshadow-passalgo=sha512

# System timezone

# set the time zone to Shanghai

Timezone-isUtc Asia/Shanghai

# System bootloader configuration

# indicate the installation location of bootloader, indicate the sort of drives, and indicate the parameters passed to the kernel after the operating system installation is complete

Bootloader-location=mbr-driveorder=sda-append= "crashkernel=auto rhgb quiet"

# Clear the Master Boot Record

# clear MBR boot record

Zerombr yes

# Partition clearing information

# erase all data on the hard drive

Clearpart-all-initlabel

# Disk partitioning information

# Custom partitions

# create a 200m partition mount / boot type is ext4

Part / boot-fstype=ext4-size=200-ondisk=sda

# create a 20000m SWAP partition

Part swap-size=20000-ondisk=sda

# create / directory

Part /-- fstype=ext4-- grow-- size=1-- ondisk=sda

# Reboot after installation

# restart after setting up

Reboot-eject

# This packages is for CentOS 6.4

# Software package customized for CentOS 6.4

% packages

@ base

@ core

@ chinese-support

# add scripts to run after installation

% post

# config service

# Custom Service

Service NetworkManager stop

Chkconfig NetworkManager off

# eject cdrom

# installation completed eject CD

# eject

# reboot

# restart after execution

# reboot-f

# end automated deployment

% end

Generate dependencies and ISO files

Pay attention to the accuracy of paths and commands

The code is as follows:

Cd / tmp/iso

Createrepo-g repodata/*comps.xml.

Mkisofs-o / tmp/CentOS-6.4_64_auto.iso-b isolinux/isolinux.bin-c isolinux/boot.cat-no-emul-boot-boot-load-size 4-boot-info-table-joliet-long-R-J-v-T / tmp/iso/

Thank you for your reading, the above is the content of "how to use Kickstart automation to install CentOS". After the study of this article, I believe you have a deeper understanding of how to use Kickstart automation to install CentOS, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 292

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report