cobbler最小化安装centos8

centos8 已经发布了GA版本,迫不及待的想尝鲜了,然后现实总是那么残酷,一直安装失败,具体安装步骤如下:

假设cobbler已配置完成。

1、下载centos8 iso镜像

1
wget http://mirrors.aliyun.com/centos/8.0.1905/isos/x86_64/CentOS-8-x86_64-1905-dvd1.iso

2、挂载

1
2
3
4
$ mount -o loop CentOS-8-x86_64-1905-dvd1.iso /mnt/
$ cd /mnt/
$ cp -r * /iso/centos8.0/
$ cd /iso/centos8.0/  AppStream  BaseOS  EFI  images  isolinux  media.repo  TRANS.TBL

3、配置kickstart文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
$ cat /var/lib/cobbler/kickstarts/centos8.0.ks
 
#version=RHEL8
 
# System authorization information
 
auth --enableshadow --passalgo=sha512
 
# System bootloader configuration
 
bootloader --location=mbr --boot-drive=sda
 
# Partition clearing information
 
clearpart --all --initlabel
 
# Use text mode install
 
#text
graphical
 
# Firewall configuration
 
firewall --disabled
 
# Run the Setup Agent on first boot
 
firstboot --disable
 
ignoredisk --only-use=sda
 
# System keyboard
 
keyboard --vckeymap=us --xlayouts='us'
 
# System language
 
lang en_US.UTF-8
 
# Use network installation
 
url --url=$tree
 
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
 
$yum_repo_stanza
 
# Network information
 
$SNIPPET('network_config')
 
# Reboot after installation
 
reboot
 
#Root password
 
rootpw --iscrypted $default_password_crypted
 
# SELinux configuration
 
selinux --disabled
 
# Do not configure the X Window System
 
skipx
 
# System timezone
 
timezone  --utc Asia/Shanghai
 
# Install OS instead of upgrade
 
install
 
# Clear the Master Boot Record
 
zerombr
 
# Allow anaconda to partition the system as needed
 
#autopart
 
part /boot --fstype="xfs" --ondisk=sda --size=500
part swap --fstype="swap" --ondisk=sda --size=2048
part / --fstype="xfs" --ondisk=sda --size=1 --grow
part biosboot --fstype="BIOS Boot" --ondisk=sda --size=2
 
 
%pre
 
$SNIPPET('log_ks_pre')
 
$SNIPPET('kickstart_start')
 
$SNIPPET('pre_install_network_config')
 
# Enable installation monitoring
 
$SNIPPET('pre_anamon')
 
%end
 
%packages
 
@^minimal-environment
@standard
 
%end

4、cobbler 导入

1
$ cobbler import --name=centos8.0 --path=/iso/centos8.0 --kickstart=/var/lib/cobbler/kickstarts/centos8.0.ks --arch=x86_64

 

发现报错,报错如下:

No signature matched

1
2
3
4
5
$ cobbler import --name=centos8.0 --path=/iso/centos8.0 --kickstart=/var/lib/cobbler/kickstarts/centos8.0.ks
task started: 2019-10-16_074659_import
task started (id=Media import, time=Wed Oct 16 07:46:59 2019)
No signature matched in /var/www/cobbler/ks_mirror/centos8.0
!!! TASK FAILED !!!

解决:

1
2
3
4
5
$ cobbler signature update
task started: 2019-10-16_074829_sigupdate
task started (id=Updating Signatures, time=Wed Oct 16 07:48:29 2019)
Successfully got file from https://cobbler.github.io/signatures/2.8.x/latest.json
*** TASK COMPLETE ***

 

5、装机

然后装机过程中报错了,截图未报错,报错信息是:报错的界面是配置"Installation Source",报错为:"Error setting up base repository",反复测试依然有问题,不知道怎么设置,没办法,只能从iso那块下手了,检查iso文件内容。

6、iso配置

iso中有AppStream和BaseOS两个目录,目录中都有Packages目录和repodata目录,将BaseOS中的 BaseOS/repodata/586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml 拷贝到 BaseOS 同级目录下,并将 AppStream/Packages 下的auth*包文件全部拷贝到BaseOS/Packages 下,然后使用 createrepo -g 586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml . 创建repodata目录。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ cd /iso/centos8.0/
$ ls
    AppStream  BaseOS  EFI  images  isolinux  media.repo  TRANS.TBL
$ cp AppStream/Packages/auth* BaseOS/Packages/
$ cp BaseOS/repodata/586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml ./
 
$ ls
    586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml  AppStream  BaseOS  EFI  images  isolinux  media.repo  TRANS.TBL
 
$ createrepo -g 586a8e96ad3b73414e5c6ae94a5e4f128a087fcb0ca9837674573a8d6cac4a9c-comps-BaseOS.x86_64.xml .
    Spawning worker 0 with 167 pkgs
    Spawning worker 39 with 166 pkgs
    Workers Finished
    Saving Primary metadata
    Saving file lists metadata
    Saving other metadata
    Generating sqlite DBs
    Sqlite DBs complete
 
$ rm -rf AppStream/repodata BaseOS/repodata

 

重新使用cobbler import,再使用最小化安装。

当然我配置的可能哪里出了问题,导致出现了"Error setting up base repository"报错,如果哪位大神解决了这个问题,欢迎评论区告知一声。

  

posted @   cptao  阅读(2630)  评论(0编辑  收藏  举报
编辑推荐:
· DeepSeek 解答了困扰我五年的技术问题
· 为什么说在企业级应用开发中,后端往往是效率杀手?
· 用 C# 插值字符串处理器写一个 sscanf
· Java 中堆内存和栈内存上的数据分布和特点
· 开发中对象命名的一点思考
阅读排行:
· 为什么说在企业级应用开发中,后端往往是效率杀手?
· DeepSeek 解答了困扰我五年的技术问题。时代确实变了!
· 本地部署DeepSeek后,没有好看的交互界面怎么行!
· 趁着过年的时候手搓了一个低代码框架
· 推荐一个DeepSeek 大模型的免费 API 项目!兼容OpenAI接口!
点击右上角即可分享
微信分享提示