Centos 6.3 custom Automatic Installation

Source: Internet
Author: User
Centos 6.3 custom Automatic Installation

I have tried centos5.x before. Today, I saw a friend asking me about the latest custom cd in the Forum. The previous method was unsuccessful. I specifically downloaded a centos 6.3 for testing and recorded the process for sharing. I found that the method is not much different from the previous one. Due to the limited level and environment, this cannot be guaranteed.

 

Test environment: VMware Workstation 8.0 centos 6.3 x86_64
First of all, download a centos 6.3
Centos 6.3:
32-bit: http://mirror.centos.org/centos/6.3/isos/i386/CentOS-6.3-i386-bin-DVD1to2.torrent
64-bit: http://mirror.centos.org/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-bin-DVD1to2.torrent

When installing the system, select the required software package for minimal installation. The installation process is similar to that of the previous version. skip this step and start the following steps:

 

1. Install the required software package:
[Root @ localhost ~] # Yum-y install createrepo mkisofs isomd5sum

 

2. Generate the RPM list required for installing the System Based on the software packages already installed in the current system
[Root @ localhost ~] # Awk '/installing/{print $2}' install. log | SED's/^ [0-9] *: // G'>/root/packages. List

 

3. Create a customized directory and copy files other than the packages directory to the new system directory.
[Root @ localhost ~] # Mkdir/mnt/CDROM
[Root @ localhost ~] # Mkdir-P/data/OS
[Root @ localhost ~] # Mount/dev/CDROM/mnt/CDROM/
[Root @ localhost ~] # Rsync-A -- exclude = packages/mnt/CDROM/data/OS/
[Root @ localhost ~] # Mkdir/data/OS/Packages

 

4. Use the script to automatically copy the required RPM package to the new CD directory packages
[Root @ localhost ~] # Vim cprpms. Sh

1.
#! /Bin/bash

2.
Src_rpms =/mnt/CDROM/Packages

3.
Dst_rpms =/data/OS/Packages

4.
Packages_list =/root/packages. List

5.
Number_of_packages = 'cat $ packages_list | WC-l'

6.
I = 1

7.
While [$ I-Le $ number_of_packages];

8.
Do

9.
Name = 'head-N $ I $ packages_list | tail-n-1'

10.
Echo "CP $ src_rpms/$ name * $ dst_rpms /"

11.
CP $ src_rpms/$ name * $ dst_rpms/

12.
I = 'expr $ I + 1'

13.
Done


[Root @ localhost ~] # Sh cprpms. Sh

 

5. Configure the Kickstart script
[Root @ localhost ~] # Vim/data/OS/isolinux/KS. cfg

1.
# Platform = x86, amd64, or Intel em64t

2.
# Firewall Configuration

3.
Firewall -- disabled

4.
# Install OS instead of Upgrade

5.
Install

6.
# Use CDROM installation media

7.
CDROM

8.
# Root Password default is "RedHat"

9.
Rootpw -- iscrypted $1 $36bscbh1 $ udj6ecqpi2nm1ksgajvhs1

10.
# System authorization information

11.
Auth -- useshadow -- passalgo = MD5

12.
# Use text mode install

13.
Text

14.
Firstboot -- disable

15.
# System keyboard

16.
Keyboard us

17.
# System Language

18.
Lang en_us

19.
# SELinux Configuration

20.
SELinux -- disabled

21.
# Do not configure the X Window System

22.
Skipx

23.
# Installation logging level

24.
Logging -- level = info

25.
# Reboot after installation

26.
Reboot

27.
# System timezone

28.
Timezone Asia/Shanghai

29.
# Network Information

30.
Network -- bootproto = DHCP -- device = eth0 -- onboot = on-noipv6

31.
# System bootloader Configuration

32.
Bootloader -- location = MBR

33.
# Clear the Master Boot Record

34.
Zerombr

35.
# Partition clearing information

36.
Clearpart -- all -- initlabel

37.
# Disk partitioning Information

38.
Part/boot -- fstype = "ext4" -- size = 100

39.
Part/-- fstype = "ext4" -- size = 5120

40.
Part swap -- size = 1024

41.
Part/data -- fstype = "ext4" -- grow -- size = 1

42.
% Packages

43.
@ Base

44.
@ Core

45.
@ Development

46.
@ Server-Policy

47.
Sgpio

48.
NTP

49.
 

6. enable the system to start installation from kickstart Configuration
[Root @ localhost OS] # Vim/data/OS/isolinux. cfg
Default Linux
Label Linux
Kernel vmlinuz
Append Ks = CDROM:/isolinux/KS. cfg initrd = initrd. IMG # modify the line

 

7. Generate the dependency of the RPM package
[Root @ localhost ~] # Cd/data/OS/
[Root @ localhost OS] # createrepo-G repodata/*-comps. xml/data/OS/
[Root @ localhost OS] # declare-x discinfo = 'head-1. discinfo'
[Root @ localhost OS] # createrepo-U "Media: // $ discinfo"-G repodata/*-comps. xml/data/OS/

 

8. generate an ISO Image File
[Root @ localhost ~] # Cd/data/OS/
[Root @ localhost OS] # mkisofs-r-J-t-r-l-D-Joliet-Long-allow-multidot \
-Allow-leading-dots-no-Bak-O/data/CentOS-6.3-x86_64.iso \
-B isolinux/isolinux. Bin-C isolinux/boot. Cat-no-emul-boot \
-Boot-load-size 4-boot-Info-table/data/OS

 

9. generate an MD5 Verification Code
[Root @ localhost ~] # Implantisomd5/data/CentOS-6.3-x86_64.iso

 

Related Article

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.