linux自动安装
来源:互联网 发布:python webui 编辑:程序博客网 时间:2024/05/17 09:09
原理:
使用光盘安装linux系统过程:
第一步,POST自检
第二步,MBR引导,这里使用的GRUB是CDROM中isolinux/文件夹中的grub.conf。
第三步,启动带有安装、升级、修复等选项的选择菜单,这是由isolinux.bin启动的。
第四步,vmlinuz(initrd)挂载根文件系统。
第五步,启动anaconda安装界面。而anaconda
详细解析:
第二步中,grub.conf菜单中定义了第三步中的引导内容。
所以这里的显示内容可以自定义
[root@centOS6 cdrom]# cat isolinux/grub.conf#debug --graphicsdefault=0splashimage=@SPLASHPATH@timeout 5hiddenmenutitle @PRODUCT@ @VERSION@ kernel @KERNELPATH@ initrd @INITRDPATH@title Install system with basic video driver kernel @KERNELPATH@ xdriver=vesa nomodeset askmethod initrd @INITRDPATH@title rescue kernel @KERNELPATH@ rescue askmethod initrd @INITRDPATH@
第三步,进入启动界面,这里定义了启动界面的各种显示内容,
由isolinux.bin执行,由isolinux.cfg提供配置文件。
display boot.msg 引用boot.msg,其配置文件为boot.cfgmenu background splash.jpgmenu title Welcome to CentOS 6.4!最上面显示的内容menu color border 0 #ffffffff #00000000定义界面的颜色显示menu color sel 7 #ffffffff #ff000000定义选项label linux menu label ^Install or upgrade an existing system menu default kernel vmlinuz append initrd=initrd.img ip=192.168.1.211 ks=cdrom:/ks.cfg 在这里指定了ks文件后,就自动使用ip进行网络启动安装了。
第五步,真正进入安装时,需要加载Packages/anaconda-VERSION.rpm文件
anaconda程序可以实现图形、字符方式的安装,而在这两种方式下,
也可以选择交互式安装或自问自答的自动安装。
anaconda安装详解:
其自动安装的配置文件是口kickstart。kickstart可以手动编写,可以文本方式生成,也可以
图形方式生成。(ks.cfg文件在安装完成后会在root家目录下生成anaconda.cfg详细配置)
下面是图形生成的步骤:
1,安装system-config-kickstart
yum install system-config-kickstart
2,启动system-config-kickstartsystem-config-kickstart &
3,配置kickstartBasic Configuration: Encrypt root password表示加密root的密码串 Target Architecture:表示平台 Reboot system after installation安装后的动作是重启,需要勾上。 Perform installation in text text mode (grphical is default) 安装界面默认使用图形界面,所以这个需要勾上。 Perform installlation in interactive mode使用交互式模式,不勾。Install Method:安装源 HTTP Server:安装源的IP HTTP Directory:目录Boot Loader Options:引导选项 Install new boot loader安装新的bootloader,下面是使用旧的。 Use GRUB password:GRUB要不要加密。 Install boot loader on Master Boot Record(MBR) 将bootloader装入MBR中 Install boot loasder on first sector of the boot partition 将bootloader装入某一个分区中引导。 kernel parameters:crashkernel=auto rhgb quiet使用静默模式。Partition Information定义分区Network Configuration网络配置Authentication认证,默认sha512就可以prepost这里不用指定#!/bin/bash
4,保存kickstart配置文件。
文件默认保存名字为ks.cfg
5,检查ks.cfg配置文件的错误。
# ksvalidator 2ks.cfg
kscfg配置文件详解:
命令段:
#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled禁用防火墙
# Install OS instead of upgrade
install默认动作是安装
# Use network installation
url --url=
"ftp://1.0.0.12/centos/"
使用FTP安装源
repo --name=
"CentOS"
--baseurl=
"ftp://1.0.0.12/centos"
# Root password
rootpw --iscrypted $
1
$dpCtQEn6$pC3UGFPZEJJ5nVftiaScq0
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text使用文本安装方式
# System keyboard
keyboard us使用美式英语键盘
# System language
lang zh_CN设置默认语言
# SELinux configuration
selinux --disabled禁用SELINUX
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=info
# Reboot after installation
reboot安装完成时的动作
# System timezone
timezone Asia/Shanghai
# Network information
network --bootproto=
static
--device=eth0 --ip=
1.0
.
0.7
--netmask=
255.0
.
0.0
--onboot=on
# System bootloader configuration
bootloader --append=
"crashkernel=auto rhgb quiet"
--location=mbr --driveorder=
"sda"
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel清空磁盘分区
# Disk partitioning information磁盘分区
part /boot --asprimary --fstype=
"ext4"
--ondisk=sda --size=
100
part / --asprimary --fstype=
"ext4"
--ondisk=sda --size=
20480
part swap --asprimary --fstype=
"swap"
--ondisk=sda --size=
500
脚本段:
%post
touch /tmp/abc.txt
%end
软件包段:
%packages
@base
@basic-desktop
@chinese-support
@core
@debugging
@desktop-debugging
@desktop-platform
@desktop-platform-devel
@development
@directory-client
@fonts
使用引导光盘引导后的选择:
点击两次"ESC"键,进入命令行模式,然后
linux ip=1.0.0.7 netmask=255.0.0.0 ks=ftp://1.0.0.12/pub/ks.cfg
ftp安装源自动安装linux详细步骤:
1,制作引导光盘:
# mount /dev/cdrom /media/cdrom/
# mkdir /root/myboot
# cp /media/cdrom/isolinux/ /root/myboot/isolinux
# cd /root/myboot/isolinux
# chmod +w ./*
# chmod +x vmlinuz
# mkisofs -R -J -T -v -no-emul-boot -boot-load-size 4 -boot-info-table -V "MageEdu Testing Image" (-V跟光盘标签) -b isolinux/isolinux.bin (明确指定isolinux.bin的存放位置) -c isolinux/boot.cat (指定boot.cat的位置) -o /tmp/boot.iso (指定输出位置) /root/myboot/ (指定输入源)
2,制作ftp安装源
# yum install vsfptd# service vsftpd start# mkdir /var/ftp/CentOS# mount /media/cdrom /var/ftp/CentOS
3,将制作好的ks.cfg文件放到ftp目录
cp /root/ks.cfg /var/ftp/pub
4,将前面的boot.iso挂载到目标主机的光驱,启动后两次"ESC"键,然后就输入:
linux ip=1.0.0.7 netmask=255.0.0.0 ks=ftp://1.0.0.12/pub/ks.cfg
5,自动安装启动
- linux自动安装
- Linux自动安装 光盘
- Linux -自动安装系统
- linux自动安装脚本
- Linux/Unix 自动安装key
- vm自动安装linux解决方法
- linux(ubuntu)mysql自动安装
- PXE自动安装Linux系统
- Linux自动安装Perl模块
- LINUX系统光盘自动安装
- linux中的自动安装脚本
- linux自动安装系统脚本
- Linux中的自动安装脚本
- Linux中的自动安装脚本
- Linux中的自动安装脚本
- Linux-自动安装的脚本
- linux中自动安装虚拟机
- MySQL Linux 手动安装 自动安装 安装教程
- Linux中环境变量文件及配置
- JXLS部分的合并单元格错误解决办法
- 用SQL完成多记录乱序查找最大值
- 织梦有关文档锚文本链接数量的处理方案
- 关于理解哈希表的除法散列法(取余法)
- linux自动安装
- XOR异或
- ztree获取选中节点
- 关于网页的颜色搭配
- [每日练习]三种冒泡排序方法
- C# - Iterator
- PHP的MySQL扩展:PHP访问MySQL的常用扩展函数
- Memcached 的介绍与命令使用
- ScrollView 滚动到最后/前/上/下