CentOS6.9下制作一键安装的ISO系统镜像-LMLPHP

CentOS6.9下制作Kickstart无人值守安装的自定义ISO镜像文章的基础上重新DIY了一个一键安装的系统镜像,省去繁琐的安装分区等设置操作系统的过程

ks.cfg配置文件如下

#platform=x86, AMD64, or Intel EM64T

#version=DEVEL

# Firewall configuration

firewall --disabled

# Install OS instead of upgrade

install

# Use CDROM installation media

cdrom

# Root password

rootpw --iscrypted $1$ymZM2uhc$2W.ZFogcbMq3qz5C7.Azd.

# System authorization information

auth  --useshadow  --passalgo=sha512

# Use graphical install

graphical

firstboot --disable

# System keyboard

keyboard us

# System language

lang en_US

# SELinux configuration

selinux --disabled

# Installation logging level

logging --level=info

# Reboot after installation

reboot

# System timezone

timezone --isUtc Asia/Shanghai

# Network information

network  --bootproto=dhcp --device=eth0 --onboot=on

# System bootloader configuration

bootloader --location=mbr

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart --all --initlabel 

# Disk partitioning information

part /boot --fstype=ext4 --asprimary --size=1024

part / --fstype=ext4 --asprimary --size=30720

part swap --asprimary --size=16384

part /home --fstype=ext4 --size=10240

part pv.008006 --grow --size=200

volgroup vg_centos --pesize=4096 pv.008006

logvol /data --fstype=xfs --name=lv_data --vgname=vg_centos --grow --size=200

%packages

@base

@compat-libraries

@debugging

@development

lrzsz-0.12.20-27.1.el6.x86_64

ftp-0.17-54.el6.x86_64

telnet-0.17-48.el6.x86_64

nc-1.84-24.el6.x86_64

iftop-0.17-1.el6.rf.x86_64

fing-3.0-1.x86_64

ncdu-1.13-1.el6.x86_64

nethogs-0.8.5-1.el6.x86_64

nmon-16g-3.el6.x86_64

nmap-5.51-6.el6.x86_64

%end

并且在制作镜像过程中需要提前上传rpm包至Packages目录中

CentOS6.9下制作一键安装的ISO系统镜像-LMLPHP

然后再使用如下命令制作ISO镜像

cd /DIY_ISO/repodata/

rm -rf *

cp /media/cdrom/repodata/*x86_64-comps.xml /DIY_ISO/repodata/comps.xml

cd ..

createrepo -g repodata/comps.xml ./

mkisofs -o YuanFan_DIY_CentOS6.9_190626_v4.ISO -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T /DIY_ISO/

CentOS6.9下制作一键安装的ISO系统镜像-LMLPHP

CentOS6.9下制作一键安装的ISO系统镜像-LMLPHP

自定义镜像的情况如下

1、自带如下网络/磁盘/监控/测试等常用工具 fing ftp iftop lrzsz nc ncdu nethogs nmon nmap telnet

fing-3.0-1.x86_64

ftp-0.17-54.el6.x86_64

iftop-0.17-1.el6.rf.x86_64

lrzsz-0.12.20-27.1.el6.x86_64

nc-1.84-24.el6.x86_64

ncdu-1.13-1.el6.x86_64

nethogs-0.8.5-1.el6.x86_64

nmap-5.51-6.el6.x86_64

nmon-16g-3.el6.x86_64

telnet-0.17-48.el6.x86_64

2、分区情况如下

├─sda1   1G  /boot /boot分区 ext4格式

├─sda2   30G /     根分区    ext4格式

├─sda3   16G  [SWAP] 交换分区

├─sda4   剩余所有磁盘空间为扩展分区

  ├─sda5   10G  /home  ext4格式

  └─sda6   剩余所有空间 均分配给/data分区 LVM xfs格式

    └─vg_centos-lv_data  lvm  /data

3、已关闭SELINUX 和iptables

4、root密码为admin@123,安装完后请使用passwd root命令自行修改

本文分享自微信公众号 - WalkingCloud(WalkingCloud2018)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

09-12 10:30