Linux automatic installation CD

Source: Internet
Author: User

Linux automatic installation CD

Human-Computer Interaction is required when linux is installed. If you install several machines at a time, it will take a lot of effort to write the settings you want to perform each time in the configuration file. one-click installation saves time and effort.

Here we will only introduce automatic installation with a CD.
The first thing we think of when no one installs kickstart is Kickstart. What is kickstart?
Kickstart is an unattended installation method. It works by recording typical parameters that require manual intervention during installation and generating a file named ks. cfg. If a parameter is required during the installation process (not limited to the machine that generates the Kickstart Installation File), the installer first searches for the file generated by Kickstart. If a proper parameter is found, the parameter is used. If no proper parameter is found, manual intervention is required by the installer. Therefore, if the Kickstart file contains all the parameters that may occur during the installation process, the installer can only tell the installer where to obtain ks. cfg file. After the installation is complete, the installation program restarts the system according to the settings in ks. cfg and ends the installation.
Obtain ks. cfg
1) You can obtain the file in graphical form, and execute system-config-kickstart in the system to follow the prompts step by step.
2) every time after installing the system will generate a file named anaconda-ks.cfg under the root, it will automatically record, the option parameters you use during installation, for the sake of safety, you can first customize the installation on the virtual machine, and then modify the file to ks. cfg
The most basic ks. cfg file consists of Command section (Command section) and % packages section (software installation section). The Command section is in front and the % Packages section is in the back.
The ks. cfg option has the following meanings:

# Inform the installer that this is a completely new installation instead of upgrading install # inform the installer that this is a network installation and FTP is used to provide the required resources for installation # I am using an anonymous method, you can also use the username/password # url -- url ftp ://
  
   
:
   
    
@
    
     
/
     
      
Url -- url = "ftp: // 192.168.80.3/pub "# Use text mode to install text # The default language is the English lang en_US.UTF-8 # use the American keyboard us # Clear mbrzerombr # specify the installation location and parameters of bootloader # -- location specifies boot record location, we do not use multiple systems here, so we will write them directly in the mbr # -- driveorder specifies the first boot device # -- append specifies the Kernel Parameter. Here I use the default value, no changes were made to bootloader -- location = mbr -- driveorder = sda -- append = "crashkernel = auto rhgb quiet" # Set the host network after installation is complete, the keyword is network # The parameters here are common, I will not explain network -- bootproto = static -- ip = 192.168.80.8 -- netmask = 255.255.255.0 -- gateway = 192.168.80.2 -- hostname = CentOS6 -- noipv6 # set the time zone # -- UTCtimezone -- utc Asia /Shanghai # Set the password encryption mode to sha512 enable the shadow file auth -- useshadow -- passalgo = sha512 # Set the root password # -- iscrypted if the root password is encrypted, you must use this parameter to obtain the encrypted password. For more information, see section 1 rootpw -- iscrypted $6 $ qQaMyYyZMjz/tpqH $ encrypt/8jesw.wtsbaefkl6hycgfmkfud/decrypt. 1 # Clear all partitions # -- all clear all partitions from the system # -- initlable initialize the disk tag. For example, my virtual machine is in the x86 architecture, it is usually initialized to MSDOSclearpart -- all -- initlabel # new disk partition # New/boot partition part/boot -- fstype = ext4 -- size = 500 # New 3 PVS, each pv is 10 Gpart pv.008002 -- size = 10240 part pv.008003 -- size = 10240 part pv.008005 -- size = 10240 # create a VG, the name vg_root contains the three PVvolgroup vg_root -- pesize = 4096 pv.008002 pv.008003 volumes # create LVlogvol/home -- fstype = ext4 -- name = lv_home -- vgname = vg_root -- size = 2048 logvol /opt -- fstype = ext4 -- name = lv_opt -- vgname = vg_root -- size = 2048 logvol/-- fstype = ext4 -- name = lv_root -- vgname = vg_root -- size = 6116 logvol/tmp -- fstype = ext4 -- name = lv_tmp -- vgname = vg_root -- size = 4096 logvol/var -- fstype = ext4 -- name = lv_var -- vgname = vg_root -- size = 4096 logvol swap -- name = lv_swap -- vgname = vg_root -- size = 2048 # disable firstboot, firstboot is a graphical installation of the system, after the restart, there is an initial setting firstboot -- disable # disable selinuxselinux -- disabled # disable firewall -- disabled # Set the Log level logging -- level = info # Set the power off after the installation is complete # I chose the Basic mode for the installation package, added chinese support % packages @ base # chinese support @ chinese-support @ console-internet @ core @ debugging @ directory-client @ hardware-monitoring @ java-platform @ large-systems @ network-file-system-client @ performance @ perl-runtime @ server-platform @ server-policy % end
     
    
   
  

We recommend that you do not install these parameters without your mind. Modify your ks. cfg.
After the ks. cfg file is generated, place the file in the iso file, and drag it to the root directory of the iso file.

Configure the isolinux. cfg file to find ks. cfg during installation.
The file is located in the isolinux folder in the ISO file. Modify the file.

label linuxkernel vmlinuzappend initrd=initrd.img ks=cdrom:/ks.cfg ksdevice=eth0

Do not forget to replace it with ISO after modification.
Now the ISO file has been created, which is very simple.
You can use a virtual machine to perform a test. If there is no problem with ISO, it will generally succeed.

This method is only applicable to a small number of servers or network conditions. If a large number of servers need to install the system, you can use PXE + kickstart to install the system from the network.

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.