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:

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:

Mkdir/root/centos7_iso

To copy a disc file:

cp-rf/root/centos7/*/root/centos7_iso/

DiskInfo file requirements are individually copied under:

Cp/root/centos7/.discinfo/root/iso

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

my ks.cfg

#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 --iscrypted  111111111111111111111111111# 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 informationpart /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

Attention:

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 createdfor 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, add your own in the isolinux.cfg file under label Linux Label:

Label Linux Menu label ^install CentOS 7 kernel vmlinuz append initrd=initrd.img inst.stage2=hd:label=centos7 quiet label Custom Menu Label ^custom CentOS 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 a LABEL CENTOS7 installation media, using The advantage of the label keyword is that you can specify the installation media precisely, why the label is CENTOS7, because I specify it when I make a disc image, and 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 in the Year 1, 7, which adds and improves the encryption code ( Cryptography), network authentication (authentication) and user interface Architecture (usersInterface Architecture).

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

go to disc catalog efi/boot/, edit the grub.cfg file and add your own menu:

Menuentry ' Install CentOS 7 '--class fedora--class gnu-linux--class GNU--class os {linuxefi/images/pxeboot/vmlin uz inst.stage2=hd:label=centos7 quiet initrdefi/images/pxeboot/initrd.img}menuentry ' Install CentOS 7 custom Byxiao li110 '--class fedora--class gnu-linux--class GNU--class os {linuxefi/images/pxeboot/vmlinuz Inst.ks=cdrom:/iso Linux/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 stepped over multiple pits, the image was successfully generated and can be The image generation commands for EFI and MBR environment installations are as follows:

Genisoimage-v-cache-inodes-joliet-long-r-j-t-v centos7-o/root/centos7.iso-c isolinux/boot.cat-bisolinux/i Solinux.bin-no-emul-boot-boot-load-size 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 genisoimage command versionof the system is different, 6 System , the ISO cannot be started 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 uses the Cdrtools tool to manage the ISO and CD-ROM,mkisofs is a tool inside Cdrtools, and later Cdrtools better licensing, from The GPL was modified to CDDL license, and the open source community introduced a GPL-based tool,cdrkit,mkisofs was also Genisoimage is removed, and now the mkisofs in the system are actually genisoimage soft connections:

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 the "xiaoli110 blog" blog, make sure to keep this source http://xiaoli110.blog.51cto.com/1724/1617541

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.