One-click automatic Linux installation using kickstart

Source: Internet
Author: User

Kickstart, unattended, and automatic system installation. This topic describes how to use Kickstart.

 

# System installation information-refer to [root @ larrywen PDF] # Vim ~ Anaconda-ks.cfg

Step 1 install kickstart

[Root @ larrywen/] # Yum installsystem-config-kickstart-y # exit, and then log on to [root @ serv01 opt] # exitlogoutconnection to 192.168.1.11 closed in the form of X Window. [root @ larrywen desktop] # SSH 192.168.1.11-X [root @ larrywen desktop] # system-config-kickstart

Step 2 generate the KS. cfg file

 

First, basic configuration. Select English (USA) as the default language, and U as the keyboard. s. select Africa/Chongqing as the time zone. We do not recommend that you select "use UTC clock" under the VM to set the root password. If you do not select the Encrypted Root Password, the password in the generated file is displayed in plaintext. In advanced configuration, select x86 as the target architecture,
Amd64, or Intel em64t, and then "rebootsystem after installation ".



Second, the installation method.Select "perfome new installation (new installation)" as the installation method, select NFS as the installation source, NFS server: 192.168.1.11, NFS Directory:/ISO

 


Third, the boot loader option.Select the installation type: install the new boot loader. If grub is ignored and not written, This is the password used to start grub. If the GRUB Password is not set, you can enter the single-user mode, however, after setting the GRUB Password, you must enter the GRUB Password in single-user mode. Install "Install Boot Loader"
On Master Boot Record (MBR) "Check this option, the kernel parameters are ignored.

 


Item 4: partition information ).Master Boot Record: Clear Master Boot Record (clear MBR ). Partitions: Remove allexisting partitions (remove all existing partitions ). Disk label: Do
Not initialize the disk lable (do not initialize the volume label ). Layout: used for testing: I like this partition:/boot (200 m) Swap (1024 M)/(other space is allocated to the root partition ).



Fifth, network configuration ).We configure an eth0 to automatically obtain the IP address.



Item 6: authentication ). Keep the default value.



Item 7: firewall configuration (firewall configuration ). We activate SELinux, enable firewall, and select SSH for Trusted Services.



Item 8: Display configuration ). After the installation in a graphical environment, we disabled the configured graphical interface when we started it for the first time.



Item 9: package selection (package selection ).Select "Chinese support" in the Language Pack.



Item 10: Pre-installation script (pre-installation script ).This is the script executed before installation, which is ignored here.



11th, post-installation (post-installation script ).This is the script executed after installation. Here we add two commands for testing.



useradd oracle;echo "testoracle" | passwd--stdin oracle;

# View the configuration file [root @ serv01 opt] # Cat Ks. CFG # platform = x86, amd64, or intel em64t # version = devel # firewall configuration # firewall -- enabled -- ssh # Install OS instead of upgrade # Install # Use NFS installation media # NFS -- Server = 192.168.1.11 -- dir =/ISO # Root Password # rootpw -- plaintext uplooking # 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 Asia/Chongqing # 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 # disk partitioning information # part/boot -- fstype = "ext4" -- size = 200 # part swap -- fstype = "swap "-- size = 1024 # part/-- fstype =" ext4 "-- grow -- size = 1 ##% post # useradd ORACLE; # echo "uplooking" | passwd -- stdin ORACLE; # % end ##% packages # @ Chinese-support ##% end #

Step 3 Configure NFS

[Root @ serv01 opt] # Vim/etc/exports [root @ serv01 opt] # Cat/etc/exports/ISO * (RO)/OPT * (RO) # Install nfs-related RPM package [root @ serv01 opt] # Yum install NFS *-y installed: nfs-utils.x86_64. 2.3-7. el6 nfs-utils-lib.x86_64. 1.5-3. el6 nfs4-acl-tools.x86_64 0: 0. 3.3-5. el6 complete! # Start the rpcbind service [root @ serv01 opt] #/etc/init. d/rpcbindstartstarting rpcbind: [OK] # Start the NFS service [root @ serv01 opt] #/etc/init. d/nfs startstarting NFS services: [OK] Starting NFS daemon: [OK] Starting NFS mountd: [OK] starting rpc idmapd: [OK] # the above two steps can be solved through service nfsstart

Step 4 disable firewall and SELinux

[root@serv01 opt]# /etc/init.d/iptablesstop[root@serv01 opt]# setenforce 0

Step 5 create a VM

Select the installation image as the boot guide, Press ESC, and enter Linux Ks = NFS: 192.168.1.11:/opt/KS. cfg: Wait for the system to be installed automatically.


5.1 Image Selection

 


5.2dhcp Configuration

 


5.3 Linux kickstart installation Interface

 

5.4 Oracle user installation successful

 

Note:

1. DHCP is required for NICs used in VMware, because DHCP is used for the system installed through Kickstart.

2. When configuring the virtual machine, we need to select the ISO image as the boot, then enter the installation interface, Press ESC, and enter nfs-related commands for installation.

3. Do not save the saved configuration file to the root directory because it is read by common users.

4. if an error occurs, it may be a spelling error, or the NFS service is incorrectly configured or not started, or the firewall is disabled or the network is disconnected.

My mailbox: wgbno27@163.com Sina Weibo: @ wentasy27 public platform: justoracle (No.: justoracle) database technology exchange group: 336882565 (when adding group verification from csdn XXX) Oracle Exchange discussion group: https://groups.google.com/d/forum/justoracleBy Larry Wen
 
@ Wentasy blog is for your reference only. Welcome to visit. I hope to criticize and correct any mistakes. If you need to repost the original blog post, please indicate the source. Thank you for the [csdn blog]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.