Linux System Automation Installation Basics
installation program
CentOS System Installation
System Startup process:
Bootloader-->kernel (INITRAMFS)-->rootfs-->/sbin/init
Note: The installation process is different from the files during the startup process
Anaconda
System installation Program
Tui: A text window based on the graphics library curses
GUI: Graphics window
Setup startup procedures
MBR:boot.cat
Stage2:isolinux/isolinux.bin
Configuration file: Isolinux/isolinux.cfg
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/7p6DRgK.png "/>
Each of the corresponding menu options:
Load kernel: Isolinuz/vmlinuz
Pass parameters to the kernel: Append initrd=initrd.img ...
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/4sZq90y.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/TWuOWFU.png "/>
Press the ESC key to enter command line mode, press TAB to edit kernel parameters directly
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/gbSZmgk.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/2ceZnCu.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/lBfL94g.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/S9cvbiS.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/T6Nok1w.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/GSl403I.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/NbJbtRA.png "/>
Mount the root file system and start Anaconda
Default Startup GUI interface
If you explicitly specify to use the Tui interface: Pass the text parameter to the kernel
(1) Press the TAB key to add text to the back
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/rqNaEBb.png "/>
(2) Press the ESC key: Boot:linux text
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/xJqBIPJ.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/TbiZSOJ.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/c6uh9iY.png "/>
Note: It is recommended to install using the text character interface during automated installation, while manual installation suggests using an image interface, because some features of the character interface are not available and the character interface is automatically enabled when the memory is less than 512M, and the graphical interface is not enabled.
Anaconda Working Process
The Anaconda installation system is divided into three stages:
1), pre-installation configuration stage
Language used in the installation process
Keyboard type
Installing the target storage device
Basic Storage: Local Disk
Special Equipment: ISCSI
Set host name
Configuring network Interfaces
Time
Administrator password
Setting the partitioning method and the installation location of the MBR
Create a normal user
Select the packages to install
2), installation phase
Create a partition on the target disk, perform a format operation, etc.
Installs the selected package to the target location
Installing bootloader and Initramfs
3), first boot (firstboot)
Iptables
SELinux
Core Dump
Note that when the system is installed, Firstboot is turned off by default, so startup needs to modify the value in the/etc/sysconfig/firstboot file to Yes
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/kGONHil.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/703dKE6.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/6qhTj7Z.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/npruYki.png "/>
Note: When we exit this interface again, the value in/etc/sysconfig/firstboot is changed to No
System Installation
The boot installation process should generally be located in the boot device (BOOT.ISO), and subsequent Anaconda and the packages it installs are available in the following ways:
Local Disc
Local hard disk
FTP Server:yum Repository
HTTP Server:yum repostory
NFS Server
If you want to specify the installation source manually:
Boot:linux Askmethod
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/LJwBVvo.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/oSSn8CK.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/4Kveo5v.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/auaFrL0.png "/>
After that is the normal installation interface, but the installation package is obtained from the corresponding media
How to configure Anaconda:
(1) Interactive configuration mode
(2) Automatically complete the configuration by reading the configuration file given beforehand;
Configuration options given by a specific syntax;
Kickstart file (answer file)
Install boot boot option: Boot:
Text: How to install texts
Askmethod: Manually specify the installation method to use
Network-related boot options:
Ip=ipaddr
Netmask=mask
Gateway=gw
Dns=dns_server_ip
Ifname=name:mac_addr
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/wFymi0y.png "/>
Options such as direct configuration number IP address
Boot options related to the remote access feature:
Vnc
Vncpassword= ' PASSWORD '
Indicate the location of the Kickstart file: ks=
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/LbRY0HH.png "/>
DVD Drive:ks=cdrom:/path/to/kickstart_file
Hard drive:ks=hd650) this.width=650; "Title=":d evice: "class=" emoji "style=" border-top:0px;border-right:0px; Border-bottom:0px;padding-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right : 0px; "alt=":d evice: "src=" Https://assets-cdn.github.com/images/icons/emoji/device.png "width=" "height=" 20 "/ >/directory/kickstart_file
HTTP Server:ks=http://host:port/path/to/kickstart_file
FTP Server:ks=ftp://host:port/path/to/kickstart_file
HTTPS Server:ks=https://host:port/path/to/kickstart_file
NFS server:ks=nfs650) this.width=650; "title=": Host: "class=" emoji "style=" border-top:0px;border-right:0px; Border-bottom:0px;padding-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right : 0px; "alt=": Host: "src=" Https://assets-cdn.github.com/images/icons/emoji/host.png "width=" "height="/>/ Path/to/kickstart_file
Activate emergency rescue mode:
Rescue
Official document: "Installation Guide"
Format of Kickstart file
Command segment: Indicates various pre-installation configuration, such as keyboard type;
Package Segment: Indicates the package group or package to be installed, packages not installed, etc.;
%packages
@group_name
Package
-package
%end
Script segment:
%pre: Pre-installation script
Operating environment: Micro-Linux environment running on installation media
%post: Post-installation script
Operating environment: installation of completed systems
Commands in the command segment:
Required commands
Authconfig: Authentication Mode configuration
Authconfig--useshadow--passalgo=sha512
Installation location and related configuration of Bootloader:bootloader
Bootloader--LOCATION=MBR--driveorder=sda–
append= "Crashkernel=auto rhgb quiet"
Keyboard: Setting Keyboard type
Lang: Language type
Part: Creating Partitions
ROOTPW: Indicates the root password
TimeZone: Time zone
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/FaQqn7o.png "/>
Optional commands
Install OR Upgrade
Text: Installation Interface
Network
Firewall
SELinux
Halt
Poweroff
Reboot
Repo
User: Create a new user for the system after the installation is complete
URL: Indicates the installation source
Key–skip Skip installation number for Rhel version
Kickstart file creation
How to create a Kickstart file:
(1) Direct manual editing;
Modify according to a template, such as Anaconda-ks.cfg
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/Av2sDnH.png "/>
(2) The creation tool can be used: system-config-kickstart (graphical tool)
Modify and generate a new configuration based on a template;
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/nZgfFGo.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/YT7DyxZ.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/7XrVHa3.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/p5jpzUQ.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/tWSopDd.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/j1uel3l.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/pjHEj5Q.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/XY10kUy.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/G8AABqY.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/Y0wSVUA.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/rrtPVFJ.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/VCog0n9.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/9Y2Miq5.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/xC6nsnH.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/knOZaqg.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/aJ9e2JR.png "/>
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/diQC4XS.png "/>
Note: Shut down the firewall, under normal circumstances, automated installation can be convenient for us to operate, but also prone to unpredictable circumstances, so recommended semi-automatic installation
Check the KS file for syntax errors: ksvalidator
# Ksvalidator/path/to/kickstart_file
Making a bootable CD and USB flash drive
To create a bootable disc:
#cp/media/cdrom/isolinux//tmp/myiso/
Note: Copy/isolinux/the entire directory, not just the content
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/lqora7M.png "/>
#vim/tmp/myiso/isolinux/isolinux.cfg
Initrd=initrd.img text Ks=cdrom:/myks.cfg
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/KKJmAhf.png "/>
#cp/root/myks.cfg/tmp/myiso/
#cd/tmp
# mkisofs-r-j-t-v--no-emul-boot--boot-load-size 4--boot-info-table-v "CentOS 6.8 x86_64 Boot"-B isolinux/isolinux . bin-c Isolinux/boot.cat-o/root/boot.iso myiso/
650) this.width=650; "Style=" border-top:0px;border-right:0px;border-bottom:0px;padding-bottom:0px;padding-top:0 px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "src=" Http://i.imgur.com/mzwzGQB.png "/>
Note: In the burn disc boot, be aware that the above command is running under the parent directory of the Myks directory
After running, we can start the generated boot.iso using a recorder or direct CD boot.
Create a USB drive boot disk
#dd if=/dev/sr0 Of=/dev/sdb
This article is from the "Autumn Wind Night Rain" blog, please be sure to keep this source http://2849159106.blog.51cto.com/7881853/1859231
Linux System Automation Installation Basics