Linux Automatic Installation

Source: Internet
Author: User

Principle:
Install linux on a CD:

Step 1: POST self-check
Step 2: MBR boot. The GRUB used here is grub. conf in the isolinux/folder of CDROM.
Step 3: Start the menu with options such as installation, upgrade, and repair. This menu is started by isolinux. bin.
Step 4: vmlinuz (initrd) mounts the root file system.
Step 5: Start the anaconda installation interface. While anaconda

Detailed analysis:

In step 2, the grub. conf menu defines the boot content in step 3.
Therefore, the content displayed here can be customized.

[Root @ CentOS6 cdrom] # cat isolinux/grub. conf
# Debug -- graphics
Default = 0
Splashimage = @ SPLASHPATH @
Timeout 5
Hiddenmenu
Title @ PRODUCT @ VERSION @
Kernel @ KERNELPATH @
Initrd @ INITRDPATH @
Title Install system with basic video driver
Kernel @ KERNELPATH @ xdriver = vesa nomodeset askmethod
Initrd @ INITRDPATH @
Title rescue
Kernel @ KERNELPATH @ rescue askmethod
Initrd @ INITRDPATH @

Step 3: Enter the startup interface, which defines various display content of the startup interface,
It is executed by isolinux. bin and the configuration file is provided by isolinux. cfg.

Display boot. msg
Reference boot. msg. The configuration file is boot. cfg.
Menu background splash.jpg
Menu title Welcome to CentOS 6.4! Content displayed at the top
Menu color border 0 # ffffffff #00000000 define the color display of the interface
Menu color sel 7 # ffffffff # ff000000
Define options
Label linux
Menu label ^ Install or upgrade an existing system
Menu default
Kernel vmlinuz
Append initrd = initrd. img
Label vesa
Menu label Install system with ^ basic video driver
Kernel vmlinuz
Append initrd = initrd. img xdriver = vesa nomodeset
Label rescue
Menu label ^ Rescue installed system
Kernel vmlinuz
Append initrd = initrd. img rescue
Label local
Menu label Boot from ^ local drive
Localboot 0 xffff
Label memtest86
Menu label ^ Memory test
Kernel memtest
Append-

Step 5: load the Packages/anaconda-VERSION.rpm File
The anaconda program can install images and characters,
You can also choose interactive installation or automatic installation.


Anaconda Installation Details:
The configuration file automatically installed is kickstart. Kickstart can be written manually, generated in text, or
Graph Generation. (After the ks. cfg file is installed, detailed configuration of anaconda. cfg is generated in the root directory)

The steps for generating images are as follows:
1. Install system-config-kickstart.

Yum install system-config-kickstart

2. Start system-config-kickstart.

System-config-kickstart &

3. Configure kickstart

Basic Configuration:
Encrypt root password indicates the encrypted root password string
Target Architecture: Platform
Reboot system after installation is restarted and needs to be checked.
Perform installation in text mode (grphical is default)
The installation interface uses the graphical interface by default.
Perform installlation in interactive mode adopts interactive mode, which is not checked.
Install Method: Installation Source
HTTP Server: IP address of the installation Source
HTTP Directory: Directory
Boot Loader Options: Boot Options
Install new boot loader to Install the new bootloader. The old one is used below.
Use GRUB password: Do you want to encrypt GRUB.
Install boot loader on Master Boot Record (MBR)
Load bootloader into MBR
Install boot loasder on first sector of the boot partition
Load bootloader into a partition for guidance.
Kernel parameters: crashkernel = auto rhgb quiet uses silent mode.
Partition Information defines partitions
Network Configuration
Authentication. The default value is sha512.
Pre
Post is not specified here #! /Bin/bash

4. Save the kickstart configuration file.
The default file name is ks. cfg.

5. Check for errors in the ks. cfg configuration file.

# Ksvalidator 2ks. cfg

Detailed description of kscfg configuration file:
Command segment:
# Platform = x86, AMD64, or Intel EM64T
# Version = DEVEL
# Firewall configuration
Firewall -- disabled disable firewall
# Install OS instead of upgrade
Install
# Use network installation
Url -- url = "ftp: // 1.0.0.12/centos/" use FTP to install the source
Repo -- name = "CentOS" -- baseurl = "ftp: // 1.0.0.12/centos"
# Root password
Rootpw -- iscrypted $1 $ dpCtQEn6 $ pC3UGFPZEJJ5nVftiaScq0
# System authorization information
Auth -- useshadow -- passalgo = sha512
# Use text mode install
Text Installation
# System keyboard
Keyboard us uses an American English keyboard
# System language
Lang zh_CN sets the default language
# SELinux configuration
Selinux -- disabled disable SELINUX
# Do not configure the X Window System
Skipx
# Installation logging level
Logging -- level = info
# Reboot after installation
Actions when reboot installation is complete
# System timezone
Timezone Asia/Shanghai
# Network information
Network -- bootproto = static -- device = eth0 -- ip = 1.0.0.7 -- netmask = 255.0.0.0 -- onboot = on
# System bootloader configuration
Bootloader -- append = "crashkernel = auto rhgb quiet" -- location = mbr -- driveorder = "sda"
# Clear the Master Boot Record
Zerombr
# Partition clearing information
Clearpart -- all -- initlabel
# Disk partitioning information Disk partition
Part/boot -- asprimary -- fstype = "ext4" -- ondisk = sda -- size = 100
Part/-- asprimary -- fstype = "ext4" -- ondisk = sda -- size = 20480
Part swap -- asprimary -- fstype = "swap" -- ondisk = sda -- size = 500
Script section:
% Post
Touch/tmp/abc.txt
% End
Package segment:
% Packages
@ Base
@ Basic-desktop
@ Chinese-support
@ Core
@ Debugging
@ Desktop-debugging
@ Desktop-platform
@ Desktop-platform-devel
@ Development
@ Directory-client
@ Fonts

After using the boot disc:
Click the ESC key twice to enter the command line mode. Then

Linux ip = 1.0.0.7 netmask = 255.0.0.0 ks = ftp: // 1.0.0.12/pub/ks. cfg

Detailed steps for ftp installation source to automatically install linux:
1. Create a boot disc:
# Mount/dev/cdrom/media/cdrom/
# Mkdir/root/myboot
# Cp/media/cdrom/isolinux // root/myboot/isolinux
# Cd/root/myboot/isolinux
# Chmod + w ./*
# Chmod + x vmlinuz
# Mkisofs-R-J-T-v-no-emul-boot-load-size 4-boot-info-table-V "MageEdu Testing Image" (-V and CD tags) -B isolinux/isolinux. bin (specify isolinux. bin storage location)-c isolinux/boot. cat (specify boot. cat location)-o/tmp/boot. iso (specify the output location)/root/myboot/(specify the Input Source)

2. Create an ftp installation Source

# Yum install vsfptd
# Service vsftpd start
# Mkdir/var/ftp/CentOS
# Mount/media/cdrom/var/ftp/CentOS,

3. Place the created ks. cfg file to the ftp directory.
# Cp/root/ks. cfg/var/ftp/pub

4. Mount the previous boot. iso file to the optical drive of the target host. Press the "ESC" key twice after startup, and then enter:
Linux ip = 1.0.0.7 netmask = 255.0.0.0 ks = ftp: // 1.0.0.12/pub/ks. cfg

5. Automatic Installation and startup

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.