Experts teach you how to automatically install linux system (a)

  

expert teach you how to automatically install linux system: easy to install linux system friends, may feel that the installation of linux system is not too troublesome But if we install Linux system in the future without any operation, it is very powerful to install a system directly! Especially when you need to install in batches and install the system frequently, the advantages of automatic installation are fully reflected. We only need to add some modifications to the existing mirror, disk, etc. files stored in this system. Let you do the work when you install the system, no longer need to be bound by the system installation. Of course, this method can be applied to the installation methods of CD, disk, http, ftp, etc. In fact, the method is similar, can be reused n times, very cattle, there are wood? !

Not much nonsense, let's start directly, here we mainly use the CD image installation system to explain. 1, create the soul of the automatic installation of the Linux system - ks file to achieve this function we have to be a record of our configuration of the linux system configuration file ks, that is, this ks file records we will install Linux system configuration, this file will be read when the system is installed, and the installed system will be set accordingly. We need to use the system-config-kickstart software, through this software we can operate in the graphical interface (1) install system-config-kickstart software, use the command: yum install system-config-kickstart (2) installation is successful Then use the system-config-kickstart command to start the software and open the graphical interface. (3) In each option, configure the Linux system to be installed (4) Finally click on "file"-->"save file"--> select the name and path to save (the name must end in .cfg) The default is ks.cfg) Then we generate a ks file in the corresponding directory that holds our configuration of the Linux system to be installed. 2. Give our "soul" to our ISO image. (1) Mount the mirror system mount -o loop name.iso /mnt Because the contents of the /mnt directory we mount are read-only, we can create a directory new directory mkdir aaa will be /mnt Everything is tested in aaa: cp /mnt/* aaa Next we will operate in the aaa directory. (2) cd /mnt/aaa Enter the aaa directory, we will find a file and a directory (we assume the directory name is isolinux), we do not need to manage these files and directories, copy the ks file we just saved into aaa


Directory (can also be copied into the image directory, but this is not convenient for us to specify the location of the ks file in the future). 3. Re-encapsulate the directory that was added to the ks file into an iso image. Encapsulate the entire aaa directory as a new iso wake up, we will name it new.iso mkisofs -o new.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load- Size 4 -boot-info-tabie -R -J -v -T aaa/This command is long and difficult to understand. I will give some instructions on this command below. -o specifies the name of the generated image -b specifies which file is the bootable file of the CD-ROM (the file ending in .bin in the directory) -c displays the configuration information of the boot.cat file (the directory ends with .cat File) -no-emul-boot does not mimic the boot format of boot (no MBR in the CD can not boot in boot format) At this point our automatic installation image is created successfully, you can put it on the virtual machine for experiment, of course we Can also be carved into a CD, in the boot interface of the installation system, we only need to enter the location of the ks file, for our image, just enter the following command: linux ks=cdrom: ks.cfg and then hit enter Automatic installation is available. Some friends may have discovered, the final thing is to find our ks file, in the boot installation interface to indicate the location and name of ks, I have to say that you are smart, whether we are through CD, disk, ftp, http Installation system, as long as you want to auto-install, you must specify the location and name of the ks file. Of course, for different installation methods, the format of the ks file is also different. You can refer to the following figure for the file name and path according to your actual situation. Fill in, this is very important!


Copyright © Windows knowledge All Rights Reserved