CENTOS7 fully automatic installation CD making detailed

Source: Internet
Author: User

  • CENTOS7 fully automatic installation CD making detailed

    1 Copying disc files

    1) Mount ISO image

    To create a directory for mounting discs:

    Perl ">mkdir/root/centos7

    Mount ISO Image

    Mount-o Loop Centos-7.0-1406-x86_64-dvd.iso/root/centos7

    2) Copy the disc file to the edit directory for editing

    Because the mount on the ISO image is read-only, if you want to edit it, you need to copy and edit the file.

    First create the Edit directory:


    To copy a disc file:


    DiskInfo file requirements are individually copied under:


    2 Edit Ks.cfg File

    When the system installs, according to the contents of the Ks.cfg file to install, we put the ks.cfg file in the Isolinux directory:

    Cd/root/centos7_iso/isolinuxvim ks.cfg

    The contents of my ks.cfg file are as follows:

    #version =rhel/centos7 by Xiaoli110install# Keyboard Layoutskeyboard' Us '# Reboot after Installationreboot# Run The Setup Agent on first bootfirstboot--enableignoredisk--only-Use=sda# Keyboard Layoutskeyboard--vckeymap=us--xlayouts=' CN '# System Languagelang zh_cn. utf-8# Network Information#network--bootproto=dhcp--device=enp2s0--onboot=off--ipv6=auto#network--bootproto=dhcp--device=enp3s0--onboot=off--ipv6=auto#network--hostname=localhost.localdomain# Root PASSWORDROOTPW--iscrypted111111111111111111111111111# System Timezonetimezone Asia/shanghai# System Languagelang ZH_CN# Firewall Configurationfirewall--enabled--ssh# System Authorization Informationauth--useshadow--passalgo=sha512# Use CDROM installation Mediacdrom# Use graphical installgraphical# SELinux Configurationselinux--disabled# Do not configure the X Window systemskipx# System bootloader Configurationbootloader--location=mbr# Clear The Master Boot recordzerombr# Partition clearing informationclearpart--all# Disk Partitioning Inform Ationpart/boot--fstype="XFS"--size=500part/boot/efi--fstype="XFS"--size=500part swap--fstype= "swap"--size=16000part/--fstype="XFS"--grow--size=1 %packages@base@core@ Development@hardware-monitoring@performance@remote-system-management%end  

    1) because the CENTOS7 System network card rules more complex, in order to ks.cfg more general, it is best ks.cfg do not have to make network card configuration.

    2) Both the/boot and/BOOT/EFI partitions are created for compatibility with MBR and EFI mode.

    3 Configuring the MBR boot mode

    Edit the Isolinux.cfg file in the Isoliuux directory, add your own content, and add your own label to the Isolinux.cfg file under label Linux:

    7 by xiaoli110 kernel vmlinuz append initrd=initrd.img inst.stage2=hd:label=centos7 inst.ks=cdrom:/isolinux/ks.cfg 
    Note the point:

    1) Memu label behind the content is on the disc boot up the contents of the menu, ^ The following letter is the menu shortcut keys;

    2) specify Ks.cfg file location by INST.KS keyword;

    3) Inst.stages2 identifies the system according to the media location, where the use of Hd:label indicates that the search is the label CENTOS7 installation media, the advantage of using the Label keyword is that you can precisely specify the installation media, why the label is CENTOS7, is Because I specify when making a disc image, the method is described later.

    4 Configuring the EFI Boot mode

    1) EFI Introduction

    The EFI Extensible Firmware Interface (abbreviated to Extensiblefirmware Interface) is an alternative to the BIOS upgrade offered by Intel-led. Originally developed by Intel, this canonical format was referred to the UEFI forum for Promotion and Development in 2005, and later changed to the name Unified EFI (UEFI). The UEFI forum released and released the 2.1 version of the specification on January 7, 2007, which increased and improved the encryption encoding (cryptography), network authentication (authentication) and user interface Architecture (users Interface A Rchitecture).

    EFI is a modular, C-style parameter stack transfer, dynamic link form of the system, more easy to implement, more fault-tolerant and error-correcting features, shorten the system development time.

    EFI is conceptually very similar to a low-order operating system and has the ability to manipulate all hardware resources.

    2) Configure EFI Boot

    Enter the disc catalog efi/boot/, edit the Grub.cfg file, and add your own menu:

    Menuentry' Install CentOS 7 '--Classfedora--class gnu-linux--class gnu--class os { linuxefi/images/ Pxeboot/vmlinuz inst.stage2=hd:label=centos7 quiet Initrdefi/images/pxeboot/initrd.img} Menuentry  "Install CentOS 7 custom byxiaoli110 '-- Class fedora--class gnu-linux--< Span class= "title" >class gnu--class os { Linuxefi/images/pxeboot/vmlinuz Inst.ks=cdrom:/isolinux/ks.cfginst.stage2=hd:label=centos7 Quiet initrdefi/images/pxeboot/initrd.img}         

    Similar to MBR mode, indicates the Ks.cfg file location and installation source location.

    5 Creating an ISO image

    After I've stepped on multiple pits, the successful image generation and the ability to install images in EFI and MBR environments generate commands as follows:

    Genisoimage-v-cache-inodes-joliet-long-r-j-t-v centos7-o/root/centos7.iso-    c isolinux/boot.cat    -bisolinu X/isolinux.bin      -no-emul-boot-boot-load-4-boot-info-table    -eltorito-alt-boot-     b Images/efiboot.img       -no-emul-boot.   

    (1) Several pits that have been trampled in the middle:

    1) Make the image to use the CentOS7 system, do not use the CENTOS6 system, because the system genisoimage command version is different, 6 of the system produced by the ISO can not be launched in the EFI environment;

    2) If you want to start at EFI, you need to add the following parameters:

    -eltorito-alt-boot     -bimages/efiboot.img       -no-emul-boot

    3) Specify the disc label with the-v parameter

    (2) Introduction to genisoimage command parameters

    -o Specifies the name of the image file.

    -b Specifies the boot image file that is required to make the bootable disc.

    -C when making a bootable CD, all the contents of the No-eltorito-catalog in the boot image file are made into one file.

    -no-emul-boot non-analog mode start.

    -boot-load-size 4 Sets the number of loading sections.

    -boot-info-table the actual information in the launched image.

    -joliet-long uses Joliet format for directory and file names, long file name support.

    -R or-rock use rock ridgeextensions.

    -j or-joliet Use the Joliet format for directories and file names.

    -V or-verbose displays detailed information when executed.

    -T or-translation-table a conversion table for file names, for systems that do not support Rock Ridge Extensions.

    (3) Genisoimage, Mkisofs, Xorrios the difference of several commands

    Speaking of Genisoimage and mkisofs, in fact there is a little story.

    At the earliest, the Linux system used the Cdrtools tool to manage the ISO and CD-ROM, Mkisofs was a tool in Cdrtools, and later cdrtools a better license, modified from the GPL to CDDL license, the open source community has launched a set of GP-based L's tools, Cdrkit, mkisofs are genisoimage removed, now the mkisofs in the system is actually a soft connection of genisoimage:

    Ls-l/usr/bin/mkisofs/usr/bin/mkisofs,/etc/alternatives/mkisofsls-l/etc/alternatives/mkisofs/etc/ Alternatives/mkisofs-/usr/bin/genisoimage 

    Xorrios is another popular tool for making ISO images and has a parameter-asmkisofs that can be compatible with MKISO commands.

      • This article is from: Linux Tutorial Network

CENTOS7 fully automatic installation CD making detailed

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.