Bo's Oracle Station

查看: 2234|回复: 4

pxe推centos8无法切换根

[复制链接]

7

主题

29

帖子

117

积分

注册会员

Rank: 2

积分
117
发表于 2020-4-9 19:35:08 | 显示全部楼层 |阅读模式
2020-04-09 19-29-12 的屏幕截图.png
几个感觉有问题的日志截图

2020-04-09 19-32-40 的屏幕截图.png 2020-04-09 19-33-13 的屏幕截图.png
回复

使用道具 举报

7

主题

29

帖子

117

积分

注册会员

Rank: 2

积分
117
 楼主| 发表于 2020-4-9 20:01:06 | 显示全部楼层
那个问题解决了,initrd拷贝错了......但是似乎有个新问题

2020-04-09 19-59-47 的屏幕截图.png
回复 支持 反对

使用道具 举报

7

主题

29

帖子

117

积分

注册会员

Rank: 2

积分
117
 楼主| 发表于 2020-4-9 21:05:33 | 显示全部楼层
需要加inst.stonge2,不过此刻有个新问题,%pre节用不了,手动写ks似乎也不行
2020-04-09 21-01-12 的屏幕截图.png

2020-04-09 21-04-42 的屏幕截图.png 2020-04-09 21-04-37 的屏幕截图.png 2020-04-09 21-04-30 的屏幕截图.png 2020-04-09 21-04-21 的屏幕截图.png
回复 支持 反对

使用道具 举报

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-4-9 21:32:23 | 显示全部楼层
765686189 发表于 2020-4-9 21:05
需要加inst.stonge2,不过此刻有个新问题,%pre节用不了,手动写ks似乎也不行

一个可用的kickstart.cfg:
  1. #version=DEVEL
  2. # System authorization information
  3. auth --enableshadow --passalgo=sha512
  4. nfs --server=192.168.0.254 --dir=/var/ftp/pub/BaseOS
  5. # Use CDROM installation media
  6. # Use graphical install
  7. text
  8. # Run the Setup Agent on first boot
  9. firstboot --disable
  10. # Keyboard layouts
  11. keyboard --vckeymap=us --xlayouts='us'
  12. # System language
  13. lang en_US.UTF-8

  14. # Network information
  15. network  --bootproto=dhcp

  16. # Root password
  17. rootpw --plaintext redhat123
  18. # System services
  19. services --enabled="chronyd,sshd"
  20. # System timezone
  21. timezone Asia/Shanghai --isUtc
  22. # X Window System configuration information
  23. xconfig  --startxonboot
  24. # System bootloader configuration
  25. # Partition clearing information
  26. # Disk partitioning information
  27. %include /tmp/disk.txt
  28. #%end
  29. reboot
  30. %packages

  31. @^graphical-server-environment
  32. @base
  33. @core
  34. #@desktop-debugging
  35. #@dial-up
  36. @fonts
  37. @gnome-desktop
  38. @guest-agents
  39. @guest-desktop-agents
  40. @hardware-monitoring
  41. @input-methods
  42. @internet-browser
  43. @multimedia
  44. @print-client
  45. chrony
  46. kexec-tools
  47. %end

  48. repo --name=appstream --baseurl=nfs://192.168.0.254:/var/ftp/pub/AppStream

  49. %post
  50. KS_IPADDR=$(ifconfig | head -n 2 | tail -n 1 | cut -c 14- | cut -d ' ' -f 1)
  51. KS_IPADDR_SHORT=$(ifconfig | head -n 2 | tail -n 1 | cut -c 14- | cut -d ' ' -f 1 | cut -d '.' -f 4)
  52. KS_DEVICE=$( ls /etc/sysconfig/network-scripts/ifcf* | grep -v ifcfg-lo | cut -d '/' -f 5)
  53. KS_DEVICE_SHORT=$( ls /etc/sysconfig/network-scripts/ifcf* | grep -v ifcfg-lo | cut -d '/' -f 5 | cut -d '-' -f 2)
  54. cat > /etc/sysconfig/network-scripts/$KS_DEVICE <<EOF
  55. DEVICE=$KS_DEVICE_SHORT
  56. IPADDR=$KS_IPADDR
  57. NETMASK=255.255.255.0
  58. GATEWAY=192.168.0.254
  59. EOF
  60. [ $KS_IPADDR_SHORT -le 100 ] && echo "desktop$KS_IPADDR_SHORT.example.com" >/etc/hostname
  61. [ $KS_IPADDR_SHORT -gt 100 ] && echo "server$[ $KS_IPADDR_SHORT - 100 ].example.com" >/etc/hostname
  62. [ $KS_IPADDR_SHORT -le 100 ] && echo "$KS_IPADDR  desktop$KS_IPADDR_SHORT.example.com  desktop$KS_IPADDR_SHORT" >> /etc/hosts
  63. [ $KS_IPADDR_SHORT -gt 100 ] && echo "$KS_IPADDR  server$[ $KS_IPADDR_SHORT -100 ].example.com  server$[ $KS_IPADDR_SHORT -100 ]" >> /etc/hosts

  64. echo "search example.com" > /etc/resolv.conf
  65. echo "nameserver 192.168.0.254" >> /etc/resolv.conf

  66. cp -rp /etc/yum.repos.d /etc/yum.repos.d.ori
  67. rm -rf /etc/yum.repos.d/*

  68. cat >> /etc/yum.repos.d/base.repo <<EOF
  69. [BaseOS]
  70. name=BaseOS
  71. baseurl=http://192.168.0.254/pub/BaseOS
  72. gpgcheck=0
  73. [AppStream]
  74. name=AppStream
  75. baseurl=http://192.168.0.254/pub/AppStream
  76. gpgcheck=0
  77. EOF

  78. # ZB: Replace with wget of file?  Seems like a better solution in the long run.
  79. #wget -q ftp://server1/pub/gls/server1.repo -O /etc/yum.repos.d/server1.repo

  80. # Install the pub keys
  81. %end
  82. %pre
  83. # Partition Total 19028M
  84. echo "Starting PRE" > /dev/tty2

  85. DISKTYPE=$(cut -c 26-  /proc/partitions   |  head -n 3 | tail -n 1)
  86. # Partition clearing information
  87. # Disk partitioning information
  88. cat <<EOF >/tmp/disk.txt

  89. ignoredisk --only-use=$DISKTYPE

  90. bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=$DISKTYPE
  91. #CLASSROOM MACHINE(c) NEED A DISK OF: 20G
  92. clearpart --all  --initlabel
  93. part swap --fstype="swap"  --ondisk=$DISKTYPE --size=1024
  94. part pv.350 --fstype="lvmpv" --ondisk=$DISKTYPE --size=18500
  95. part /boot --fstype="xfs" --ondisk=$DISKTYPE --size=300
  96. volgroup RAC12crhel7 --pesize=4096 pv.350
  97. logvol /  --fstype="xfs" --size=18400 --name=root --vgname=RAC12crhel7
  98. EOF

  99. %end
复制代码
回复 支持 反对

使用道具 举报

7

主题

29

帖子

117

积分

注册会员

Rank: 2

积分
117
 楼主| 发表于 2020-4-10 01:10:59 | 显示全部楼层
botang 发表于 2020-4-9 21:32
一个可用的kickstart.cfg:

谢谢老师,我再去试试
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-10 01:27 , Processed in 0.082556 second(s), 27 queries .

快速回复 返回顶部 返回列表