Anaconda Introduction
Set the disc to boot the operating system for the first boot entry. When the CD-ROM starts boot.cat, and isolinux.bin These two files start the graphical boot interface, type ESC in the graphical boot interface type the boot interface, type the Boot tab, and then start the corresponding kernel and init files according to the tag information recorded by the Isolinux.cfg file, configure the IP address and Anaconda automatically install the file, start contacting the server to install the operating system automatically.
The Anaconda startup process is divided into three stages:
Pre-installation configuration: keyboard type, locale, administrator password, disk partition
Installation execution procedure: Installs the user to install the package, after the installation tree resolves the dependency, executes the installation package
First boot: Set Iptables,selinux,coredump
Kickstart configuration file Authoring and parameter descriptions
Composition of the Kickstart file
command segments: such as configuring locales, keyboard types, root passwords, and disk partitions are all set here.
Package Segment :%package (indicates the beginning of the package segment),%end (indicates the end of the package segment)
@group
Package
-package
Script segment:
%pre
Pre-installation script: The script to be executed before the installation process begins;
Note: The Linux system environment at this time is a miniature environment, so the script should be relatively simple
Such as: Create raid
%post
Post-Installation script: The script to be executed after the installation process is complete;
Note: The script execution Environment is a complete system that has already been installed;
such as: Cacti and Nagios client automatic installation and so on.
To configure the Kickstart method:
(1) Manually edit the configuration file
(2) System-config-kickstart,gui Tools
Installation: System-config-kickstart
Yum-y Install System-config-kickstart
Open: System-config-kickstart, enter System-config-kickstart directly on the command line
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6B/CA/wKioL1U3PTvyg7iMAAJWQ5DoAGw761.jpg "/>
Example: Description of the Kickstart file used by the following experiment
[[email protected] ~]# cat ks.cfg # kickstart file automatically Generated by anaconda. #version =develinstallnfs --server=172.16.4.100 --dir=/media/cdrom #程序包的位置lang en_us. utf-8 #语言环境keyboard us #键盘类型 #root password rootpw --iscrypted $6$cgsqab6d$ cd.pnnwtll5xzayr9j2zomqyjh1qodcdp1pqp0uz1f0cq4eq9.tmksqu6ifpvyzeyc32.lmf0lkuqwavnc49a0 reboot #设置完成之后重启firewall --disabled #禁用防火墙authconfig --useshadow -- passalgo=sha512 #用户认证配置, Useshadow represents the use of local authentication,--passalgo represents a cryptographic encryption algorithm selinux --disabled # Disabling selinuxtimezone asia/shanghai #设置时区为上海 # indicates the installation location of the bootloader, indicating the sequencing of the drive, indicating the parameters passed to the kernel after the operating system installation is complete bootloader --location=mbr --driveorder=sda --append= "CRASHKERNEL=AUTO CRASHKERNEL=AUTO RHGB rhgb quiet quiet "clearpart --all #清除硬盘上的所有数据part /boot -- Fstype=ext4 --size=200 #创建一个200M大小的分区挂载/boot type is ext4part pv.008002 --size=61440 #创建pv, The PV behind the part is the only indication that the number must be PV, as long as it does not clash with other PV volgroup vg0 --pesize=8192 pv.008002 #创建卷组logvol / --fstype=ext4 --name=root --vgname=vg0 --size=20480 #创建逻辑卷logvol Swap --name=swap --vgname=vg0 --size=2048logvol /usr --fstype=ext4 --name=usr --vgname=vg0 --size=10240logvol /var --fstype=ext4 --name=var --vgname=vg0 --size=20480%packages #安装的程序包组 @Base @ Core@base@basic-desktop@chinese-support@client-mgmt-tools@core@desktop-platform@fonts@general-desktop@graphical-admin-too ls@legacy-x@network-file-system-client@perl-runtime@remote-desktop-clients@x11ibus-table-cangjie #单独安装的软件ibus-table-erbiibus-table-wubilftptree%end%post #安装后的脚本sed -i ' 1,[email protected]:[0-9]:initdefault: @id: 3:initdefault:@g ' /etc/iniTtab end
Demo: Create a boot image using Kickstart.
Lab Environment:
[Email protected] ~]# cat/etc/redhat-release CentOS release 6.6 (Final) [[email protected] ~]# uname-rm2.6.32-504.el6.x8 6_64 x86_64
Pre-Configuration preparation: Configuring network sources
Configure Server for NFS: Reduce the volume of the boot image
[Email protected] ~]# mkdir/media/cdrom[[email protected] ~]# Mount/dev/cdrom/media/cdrom/[[email protected] ~]# RPM- QA | grep nfsnfs-utils-1.2.3-54.el6.x86_64nfs-utils-lib-1.1.5-9.el6.x86_64nfs4-acl-tools-0.3.3-6.el6.x86_64[[email Protected] ~]# echo "/MEDIA/CDROM/172.16.4.0/16 (Ro,sync)" >>/etc/exports[[email protected] ~]# cat/etc/exports/ MEDIA/CDROM/172.16.4.0/16 (Ro,sync) [[email Protected] ~]# Service NFS Start[[email protected] ~]# showmount-e 172.16.4.2 0Export list for 172.16.4.20:/media/cdrom 172.16.4.0/16
making an automatic installation disc
[[email protected] ~]# mkdir /tmp/cdrom #创建一个制作目录, used to store the boot file and then make the boot disk [[email protected] ~]# cp -r /media/cdrom/isolinux//tmp/cdrom/ # Copy the isolinux of the system disk to the authoring directory [[Email protected] ~]# chmod u+w /tmp/cdrom/isolinux/*[[email protected] ~]# ll /tmp/cdrom/isolinux/total 38572-rw-r--r-- 1 root Root 2048 apr 7 01:17 boot.cat-rw-r--r-- 1 root root 84 apr 7 01:17 boot.msg-rw-r--r-- 1 root root 334 Apr 7 01:17 grub.conf-rw-r--r-- 1 root root 34815427 apr 7 01:17 initrd.img-rw-r--r-- 1 root root 24576 apr 7 01:17 Isolinux.bin-rw-r--r-- 1 root root 936 apr 7 01:17 isolinux.cfg-rw-r--r-- 1 root root 165080 Apr 7 01:17 memtest-rw-r--r-- 1 root root 151230 Apr 7 01:17 splash.jpg-rw-r--r-- 1 root root 2215 apr 7 01:17 trans. tbl-rw-r--r-- 1 root root 163728 apr 7 01:17 vesamenu.c32-rwxr-xr-x 1 root root 4152336 apr 7 01:17 vmlinuz[[ email protected] ~]# cp ks.cfg /tmp/cdrom/ #复制ks. CFG to production directory [[email Protected] ~]# mkisofs -r -j -t -v--no-emul-boot --boot-load-size 4 --boot-info-table -V "Centos 6.6 x86_64boot disk" -b isolinux/ isolinux.bin -c isolinux/boot.cat -o /root/boot.iso/tmp/cdrom/
Parameters for making discs:
-R,-J,-T,-V: A fixed parameter can be added
--no-emul-boot: Does not simulate boot boot process
--boot-load-size: Boot-time mount size is 4
--boot-info-table: Add table when booting
-V: Indicates the disc label
-B: Indicates the boot file
-C: Indicates the boot file that displays the menu at boot time
-O: Indicates where the creation is done
If using a boot image:
(1) Create a new virtual machine and put the bootable CD in
(2) The boot will appear a selection menu, enter ESC built, enter the character start screen.
(3) After entering the character Start screen, enter Linux, which means to install the operating system, configure the IP address and subnet mask to communicate with the NFS server on the network, then indicate the location of the ks.cfg, then enter.
650) this.width=650; "style=" Float:none; "title=" Boot.png "src=" http://s3.51cto.com/wyfs02/M00/6B/CE/ Wkiom1u3ppbxlkcqaacv0jpvwhi525.jpg "alt=" Wkiom1u3ppbxlkcqaacv0jpvwhi525.jpg "/>
After the carriage return, the way is automatically configured, and then nothing needs to be done, the installation is complete.
650) this.width=650; "style=" Float:none; "title=" install. png "src=" http://s3.51cto.com/wyfs02/M01/6B/CE/ Wkiom1u3pp2apxnkaahvrlaj5vs513.jpg "alt=" Wkiom1u3pp2apxnkaahvrlaj5vs513.jpg "/>
Kickstart and the production of the Guide image