使用novnc重装系统
#服务器前期能正常登陆,需要重装系统操作
1 查看IP地址网关信息
1: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 1a:29:02:b7:8c:6a brd ff:ff:ff:ff:ff:ff
inet 172.16.23.245/24 brd 172.16.23.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fe80::1829:2ff:feb7:8c6a/64 scope link
valid_lft forever preferred_lft forever
2下载所需文件
cd /boot
wget http://mirrors.163.com/centos/7.8.2003/os/x86_64/images/pxeboot/vmlinuz
wget http://mirrors.163.com/centos/7.8.2003/os/x86_64/images/pxeboot/initrd.img
3编辑引导相关文件
先查看cat /boot/grub2/grub.cfg 中文件找到menuentry,部分拿出来,修改如下
vim /etc/grub.d/40_custom
menuentry 'NetInstall' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod xfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' aa595663-91c9-4026-88cf-59ccd18cce92
else
search --no-floppy --fs-uuid --set=root aa595663-91c9-4026-88cf-59ccd18cce92
fi
linux16 /vmlinuz inst.vnc inst.vncpassword=123456 inst.headless ip=172.16.23.245::172.16.23.1:255.255.255.0::eth0:none nameserver=114.114.114.114 inst.repo=http://mirrors.163.com/centos/7.8.2003/os/x86_64/ inst.lang=en_US inst.keymap=us
initrd16 /initrd.img
}
#部分名词解释
#启用vnc
inst.vnc
inst.vncpassword=123456 # vnc 登陆密码(至少是8个及其以上的字符)
inst.headless
#ip=ip::网关:子网掩码::设备名称:none
ip=172.16.23.245::172.16.23.1:255.255.255.0::eth0:none #IP需要能连接外网
# DNS地址
nameserver=114.114.114.114
# yum源地址
inst.repo=http://mirrors.163.com/centos/7.8.2003/os/x86_64/
# 默认语言
inst.lang=en_US
# 键盘模式
inst.keymap=us
# 配置/etc/default/grub
打开 /etc/default/grub
修改 GRUB_DEFAULT=0 为 GRUB_DEFAULT=saved
4. 重建配置,使配置生效
# 然后重新生成引导文件:
grub2-mkconfig -o /boot/grub2/grub.cfg
# 列出所有启动条目
awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
# 下一次启动使用NetInstall,仅使用一次
grub2-reboot NetInstall
# 重启系统
reboot
##HP机器 4T 硬盘系统盘
menuentry 'NetInstall' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod xfs
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 --hint='hd0,gpt2' 7334e9f9-8e1c-4a8d-ad1a-39dbdb2febe9
else
search --no-floppy --fs-uuid --set=root 7334e9f9-8e1c-4a8d-ad1a-39dbdb2febe9
fi
linux16 /vmlinuz inst.vnc inst.vncpassword=123456 inst.headless ip=172.16.70.2::172.16.70.1:255.255.255.0::eth0:none nameserver=114.114.114.114 inst.repo=http://mirrors.163.com/centos/7.8.2003/os/x86_64/ inst.lang=en_US inst.keymap=us
initrd16 /initrd.img
}

浙公网安备 33010602011771号