Many friends also use the CD-ROM installation of the CentOS operating system, after the CD-ROM start will give a selection of the interface step-by-step selection after the start of the formal installation, if it is installed a server operating system, so also say, if you wait for us to install hundreds of times, Can it be a way to manually select the configuration option for the first station, it is clear that this operation is very foolish, so we can let it according to a standard template automation to configure after the installation. CentOS Series operating system CD-ROM Installation Manager Anaconda has provided us with this function, but everyone did not do too much research, then today we will take you to learn how to use anaconda to implement some automated installation process.
First, the CD-ROM installation of the boot process:
Bootloader-->kernel (INITRAMFS)-->anaconda (Automated Installation Management program)
Anaconda:tui cureses-based text configuration interface
GUI based on graphical interface
MBR:boot.cat
Stage2:isolinx/isolinux.bin
Configuration file: Isolinux/isolinux.cfg (menu file)
Each of the corresponding menu options:
Load kernel: Isolinux/vmlinuz
Passing parameters to the kernel: Append initrd=initrd.img
Mount the root file system and start Anaconda (the default interface is GUI, use GUI,RAM>=512MB)
If you need to start the Tui interface, you need to pass the parameter text to the kernel
Manually start TUI: Disc boot menu-Press ESC-Input: Linux text--> press ENTER to start
Second, the working process of Anaconda:
(i) Pre-installation configuration phase
1, the language used by the operating system
2, keyboard type
3. Install the target storage device
Basic storage: Local Disk
Special storage: Specify a different storage device
4, set host name
5, configuring the network interface
6, set time zone
7, set the management password
8, set the partition mode and the MBR installation location
9, select the installation mode (graphical interface | character interface) and warehouse location
(ii) Installation phase
1, create partitions on the directory disk and perform formatting
2. Install the packages included in the selected mode
3, install bootloader
third, the final stage of installation : First start-up (graphical interface) configuration iptables, SELinux, Coredump
Four, the Anaconda configuration method:
1, interactive configuration mode
2. Read the preconfigured configuration file: Kickstart file
Kickstart file Generation tool: System-config-kickstart
Kickstart File Grammar checker tool: Ksvaliadator
V. Installation boot options:
(i) KS: Indicates the path to the Kickstart file
DVD Drive:ks=cdrom:/path/to/kickstart_file
Hard Drive:ks=hd:/dev/sd#/path/to/kickstart_file
HTTP server:ks=http://host[:p Ort]/path/to/kickstart_file
HTTPS server:ks=https://host[:p Ort]/path/to/kickstart_file
FTP server:ks=ftp://host[:p ort]/path/to/kickstart_file
(ii) Kickstart file format:
1. Command segment: specify various pre-installation configuration options, such as keyboard type, time zone, etc.
2. Package segment: indicates which packages to install, package groups, and packages that are not installed
%packages Package Segment Start character
@group_name Installed package Groups
Package-Installed Packages
-package packages that are not installed
%end Package Segment Terminator
3. Script segment:
%pre scripts executed prior to installation
Operating environment: micro-Linux system environment on installation media, only simple commands can be run
%post scripts to execute after installation
Operating environment: Installation of completed systems, commands can be written more complex
4. Required commands in the command section :
Authconfig: Authentication Mode configuration
Authconfig--enableshadow--passalgo=sha512
Bootloader: Define the installation location and related configuration of the bootloader
bootloader--local=mbr--driveorder=sda--addend= "Crashkernel=auto rhgb quiet"
Keyboard: Setting the keyboard type
Keyboard US
Lang: Language type
Lang Zh_cn. UTF-8
Part: Partition layout
Part/boot--FSTYPE=EXT4--size=500
Part pv.008002--size=51200
ROOTPW: Administrator Password
ROOTPW--iscrypted $6$oxcphgkqhyojeoev$x/stabkjoh7ulnlo1rcik
How to generate an encrypted password: OpenSSL passwd-1-salt ' OpenSSL rand-hex 4 '
TimeZone: Time zone setting
TimeZone Asia/shanghai--ISUTC--NONTP
Additional: partition-related other directives
Clearpart: Clear Partition
Clearpart--none--DRIVES=SDA Empty disk partition
Volgroup: Creating a volume Group
Volgroup MYVG--peesize=4096 pv.008002
Logvol: Creating a logical volume
Logvol/home--FSTYPE=EXT4--name=lv-home--VGNAME=MYVG--size=5120
5. Optional command:
Install or upgrade: installation or upgrade
Test: Installation Interface type text for TUI defaults to GUI
Network: Configuring the Networking Interface
Network--onboot Yes--device eth0--bootproto DHCP--noipv6
Firewall: Firewall
Firewall--disabled
Selinux:linux Security Policy
SELinux--disabled
(iii) Disable firewall after system installation is complete
Centos 6:
Service Iptables Stop
Chkconfig iptables off
Centos 7:
Systemctl Stop Firewalld
Systemctl Disable Firewall
(d) Disabling SELinux after system installation is complete:
Edit/etc/sysconfig/selinux/or/etc/selinux/config files
Modify the SELinux parameter to Disabled or permissive
Get SELinux current status: Getenforce
Immediate effect method: Setforce=0
(v) Repo: Indicates the warehouse used during installation
Repo--name= "Centos"--baseurl=cdrom:sr0--cost=100
URL--url=http://10.10.1/cobbler/ks_mirror/centos-6.8-x86-64/
Halt, Poweroff, or reboot: Behavior after installation is complete
Reference Official Document: "Installation Guide"
Six, hand-made Linux bootable CD:
1, copy the Isolinux directory under the official CD to the/root/myiso directory
2, add write permission to all files of/root/myiso/isolinux
3, modify the Isolinux.cfg file under the/root/myiso/isolinux directory, append initrd=initrd.img add a parameter after Ks=cdrom:/ks.cfg
4, make Kickstart auto answer configuration file, place in Myiso directory, specify repo use network warehouse
5. Make the/root/myiso directory into an ISO file
Mkisofs-r-j-t-V--no-emul-boot--boot-load-size 4--boot-info-table-v "Mybootcd"-C isolinux/boot.cat-b Isolinux/iso Linux.bin-o Root/mybootcd.iso Mysio
Of course, this is just using the CD to start the Installation Manager Anconda, using the KS Auto answer file to achieve a semi-automated installation effect, of course, we can use the network card PXE module, directly connected to the Internet, through the pre-built DHCP server automatically assigned an IP address, Connect to the system mirror server again to achieve a fully automated unattended installation, the CD-ROM boot process is completely free. Of course, in the subsequent server plate I will also give you to share, please look forward to.
This article is from the "Love Firewall" blog, be sure to keep this source http://183530300.blog.51cto.com/894387/1854246
CentOS System semi-automated installation