PXE安装Rocky系统

1.下载Kickstart检查文件语法

yum install -y pykickstart 
ksvalidator /path/to/ks.cfg

2. 修改tftp配置文件

在这里插入图片描述

  • 若是该目录下没有其他文件,可以不用修改

3. 挂载rocky镜像

[root@oldboy99-Kylin-pxeServer /var/www/html/rocky]# mount /dev/cdrom ./
  • 注意路径

4. 添加配置文件

  • yum install -y syslinux
[root@oldboy99-Kylin-pxeServer /var/lib/tftpboot/rocky]# cp /usr/share/syslinux/pxelinux.0 ./
[root@oldboy99-Kylin-pxeServer /var/lib/tftpboot/rocky]# mkdir pxelinux.cfg/
[root@oldboy99-Kylin-pxeServer /var/lib/tftpboot/rocky]# cp /var/www/html/rocky/* ./ -r
[root@oldboy99-Kylin-pxeServer /var/lib/tftpboot/rocky]# mkdir pxelinux.cfg
[root@oldboy99-Kylin-pxeServer /var/lib/tftpboot/rocky/pxelinux.cfg]# cp /var/www/html/rocky/isolinux/isolinux.cfg ./default 

5. 修改default文件

default vesamenu.c32
timeout 600
prompt 0
display boot.msg

# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png
menu title Kylin Linux Advanced Server V10
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13
menu width 80

# Border Area
menu color border * #00000000 #00000000 none

# Selected item
menu color sel 0 #ffffffff #00000000 none

# Title bar
menu color title 0 #ff7ba3d0 #00000000 none

# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none

# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none

# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none

# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none

# Help text
menu color help 0 #ffffffff #00000000 none

# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none

# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none

# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none

# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.

menu tabmsg Press Tab for full configuration options on menu items.

menu separator # insert an empty line
menu separator # insert an empty line

label rocky 
  menu label ^Install rocky 9.3 
  menu default
  kernel vmlinuz
  append initrd=initrd.img inst.repo=http://10.0.0.203/rocky inst.ks=http://10.0.0.203/ks/rocky_ks.cfg quiet net.ifnames=0 biosdevname=0
   
label check
  menu label Test this ^media & install Kylin Linux Advanced Server V10
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=Kylin-Server-10 rd.live.check quiet

menu separator # insert an empty line

# utilities submenu
menu begin ^Troubleshooting
  menu title Troubleshooting

label vesa
  menu indent count 5
  menu label Install Kylin Linux Advanced Server V10 in ^basic graphics mode
  text help
	Try this option out if you're having trouble installing
	Kylin Linux Advanced Server V10.
  endtext
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=Kylin-Server-10 nomodeset quiet

label rescue
  menu indent count 5
  menu label ^Rescue a Kylin Linux Advanced Server system
  text help
	If the system will not boot, this lets you access files
	and edit config files to try to get it booting again.
  endtext
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=Kylin-Server-10 rescue console=tty1 quiet

label memtest
  menu label Run a ^memory test
  text help
	If your system is having issues, a problem with your
	system's memory may be the cause. Use this utility to
	see if the memory is working correctly.
  endtext
  kernel memtest

menu separator # insert an empty line

label local
  menu label Boot from ^local drive
  localboot 0xffff

menu separator # insert an empty line
menu separator # insert an empty line

label returntomain
  menu label Return to ^main menu
  menu exit

menu end

6. 配置ks.cfg文件

  • 路径:/var/www/html/ks/rockt_ks.cfg
# Generated by Anaconda 34.25.3.8
# Generated by pykickstart v3.32
#version=RHEL9
# Use graphical install
graphical
# repo --name="AppStream" --baseurl=file:///run/install/sources/mount-0000-cdrom/AppStream

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

# Keyboard layouts
keyboard --xlayouts='cn'
# System language
lang zh_CN.UTF-8

# Network information
network  --bootproto=dhcp --device=ens160 --gateway=10.0.0.2 --nameserver=223.5.5.5,223.6.6.6 --netmask=255.255.255.0 --ipv6=auto --activate
network  --hostname=oldboy99-rocky

# Use CDROM installation media
#cdrom
url --url="http://10.0.0.203/rocky/"
#repo --name="AppStream" --baseurl="http://10.0.0.203/rocky/AppStream/" --cost=1

%packages
@^minimal-environment
@development
@standard

%end

# Run the Setup Agent on first boot
firstboot --enable

# Generated using Blivet version 3.6.0
ignoredisk --only-use=nvme0n1
autopart
# Partition clearing information
clearpart --none --initlabel

# System timezone
timezone Asia/Shanghai --utc

# Root password
# rootpw --iscrypted --allow-ssh $6$KZUUmTGxsY6eYCgf$ETSJY4aT145d.bbYMBlwcjR59GVGSGuPlkFtW1VpaokCACIGZB/De7zMJyaZwcWbiNjpu.rnobMNeSW2YuZmB.
rootpw --iscrypted $6$KZUUmTGxsY6eYCgf$ETSJY4aT145d.bbYMBlwcjR59GVGSGuPlkFtW1VpaokCACIGZB/De7zMJyaZwcWbiNjpu.rnobMNeSW2YuZmB.
reboot

7. 踩坑记录

1. anaconda installer errors end

在这里插入图片描述

  • 缺少ks.cfg文件

2. 客户机系统已禁用CPU

在这里插入图片描述

  • 扩大内存

3. 到系统参数配置界面就卡住

在这里插入图片描述

  • 没读取到ks文件
  • 修改default文件
prompt 0
……
label rocky
  menu label ^Install rocky 9.3
  menu default
  kernel vmlinuz
  append initrd=initrd.img inst.repo=http://10.0.0.203/rocky inst.ks=http://10.0.0.203/ks/rocky_ks.cfg quiet
……

4. the requested URL retuened error:404

在这里插入图片描述

  • 没挂载镜像文件

5. 安装源一直报错

在这里插入图片描述

在这里插入图片描述

  • 上面url没问题,是下面的软件仓库路径错误

  • 在这里插入图片描述

  • AppStream不能冲突

  • 在这里插入图片描述

  • 把cfg文件中repo行注释起来

  • 每次修改cfg文件后要用ks检测一下语法

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

孙克旭​‌​

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值