全自动安装 linux光盘,CentOS 7.1全自动安装光盘制作详解
安裝系統的話,常用方式就是通過U盤,光盤,kickstart網絡自動化安裝,網絡自動化安裝固然好,但是有時候在現場做項目的話根本就沒有kickstart環境,甚至連基本的網絡建設都沒有弄好,此時該如何安裝系統呢,通過u盤或者光盤,手動安裝的話需要很多選項要自己填寫,那么我們能不能把自動化的ks環境做到系統鏡像里面去呢,答案是很定的,接下來我們就來介紹CentOS 7.1全自動安裝光盤制作
第一步我們掛載原始光盤鏡像,假如掛載點是/mnt/cdrom,然后做如下操作
cp -ar /mnt/cdrom/* /tmp/martin/
cp -ar /mnt/cdrom/.treeinfo /tmp/martin/
cp -ar /mnt/cdrom/.discinfo /tmp/martin/
createrepo -g/tmp/martin/repodata/*-comps.xml /tmp/martin/
/tmp/martin/isolinux
boot.cat?grub.conf?? isolinux.bin? ks_a.cfg?ks_raid_ab.cfg?memtest???? TRANS.TBL??? vesamenu.c32
boot.msg?initrd.img? isolinux.cfg? ks_b.cfg?ks_raid_bc.cfg? splash.png? upgrade.img?vmlinuz
在該目錄下面新建四個ks文件,其實只要一個即可,這里做成四個是為了硬盤不同的分區方案而做的,
這里我們只介紹一個ks_raid_ab.cfg的配置,其實就是一份定義了軟raid的分區
# platform=x86, AMD64, or Intel EM64T
# Use text mode install
#text
# Use graphical install
graphical
# Install OS instead of upgrade
install
# Use CDROM media
cdrom
# Use NFS installation media
#nfs --server=172.16.15.10 --dir=/centosinstall
# Use HTTP installation media
#url --url ftp://172.16.15.10/Public/iso/7.1-x64/
# Use FTP installation media
#url --url ftp://:@/
#url --url ftp://172.16.15.10/
# System language
lang en_US.UTF-8
# System keyboard
keyboard us
# Network information
network --bootproto=dhcp ?--hostname martin --onboot=on
#Root password
rootpw ?123456
#firewall --enabled --ssh
firewall --disable
# System authorization information
authconfig --useshadow ?--enablemd5
# SELinux configuration
selinux --disabled
# System timezone
timezone Asia/Shanghai
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
#clearpart --all --initlabel --drives=sda
#part /boot --fstype="ext4" --size=300 --ondisk=sda
#part pv.01 --size=4096 --grow --ondisk=sda
#volgroup VolGroup00 --pesize=32768 pv.01
#logvol / --fstype="ext4" --name=LogVol00 --vgname=VolGroup00 ?--size=1024 --grow
#logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=512
# Partition clearing information
clearpart --all --initlabel
# Soft RAID1 partitioning information
part swap --fstype="swap" --ondisk=sda --size=4096
part raid.01 --fstype="raid" --grow --ondisk=sda --size=1
part swap --fstype="swap" --ondisk=sdb --size=4096
part raid.02 --fstype="raid" --grow --ondisk=sdb --size=1
raid / --device=md0 --fstype="ext4" --level=1 raid.01 raid.02
# Reboot after installation
reboot
# Do not configure the X Window System; if to configure it, uncomment following line
skipx
# X Window System configuration information
#xconfig ?--defaultdesktop=GNOME --depth=32 --resolution=1024x768
%packages
@ additional-devel
@ base
@ core
@ debugging
@ gnome-desktop
@ development
@ mariadb
@ emacs
@ web-server
@ network-file-system-client
@ java-platform
@ platform-devel
@ php
expect
iptraf-ng
libaio-devel
libpcap-devel
lksctp-tools
lrzsz
nasm
net-snmp-utils
php-mysql
php-pear
php-soap
system-config-kickstart
# Add these system perfomance enhanced tools
vsftpd
logwatch
postfix
nmap-ncat
nmap
ftp
telnet
lsscsi
# Update the sysstat version from 9.0.4 to 10.1.6
sysstat
%end
[[email?protected] isolinux]# vim isolinux.cfg ?修改該文件,增加如下內容
label ks_a
menu label ^Custom ks_a CentOS 7 --This is sinlgle_a
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:/dev/cdrom inst.ks=cdrom:/isolinux/ks_a.cfg
label ks_b
menu label ^Custom ks_b CentOS 7 --This is sinlgle_b
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:/dev/cdrom inst.ks=cdrom:/isolinux/ks_b.cfg
label ks_ab
menu label ^Custom ks_ab CentOS 7 --This is raid_ab
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:/dev/cdrom inst.ks=cdrom:/isolinux/ks_raid_ab.cfg
label ks_bc
menu label ^Custom ks_bc CentOS 7 --This is raid_bc
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:/dev/cdrom inst.ks=cdrom:/isolinux/ks_raid_bc.cfg
此時我們將該目錄/tmp/martin/ ? 重新生成鏡像即可,centos7.1原始鏡像有7個多G,我們可以對其做裁剪,方法我們下次介紹
本文出自 “martin” 博客,謝絕轉載!
總結
以上是生活随笔為你收集整理的全自动安装 linux光盘,CentOS 7.1全自动安装光盘制作详解的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 苹果x参数配置(苹果x参数配置尺寸)
- 下一篇: 用wps制作有照片的厂牌(用WPS或者w